Re: [PHP4BETA] PHP on Linux box - Linux version for heavy site?

From: Date: Wed, 15 Mar 2000 11:11:32 +0000
Subject: Re: [PHP4BETA] PHP on Linux box - Linux version for heavy site?
References: 1  Groups: php.version4 
Request: Send a blank email to php-version4+get-12152@lists.php.net to get a copy of this message
: FN>> 256 threads limit means that MySQL (or Apache) cannot process : FN>> more than 256 queries at a time. *Loaded* sites may get 1000 : FN>> reads at a time (include local cron daemons and other stuff as well). : : Let's see how much memory we'll need. If I suppose every Apache of 1000 : uses 1M of memory, here we have 1G. If I suppose every MySQL takes another : 1G, we have 1G more. And I didn't touch memory needed for all others, and : we have hard 4G limit, AFAIK. In fact, 100 Apache's fill up 256M, so I : suppose 1000 Apaches make more than 2G of memory. And MySQL is not taking : too little memory too. So you'll hit memory limit before you'll hit thread : limit. And you should use number of machines for such load anyway. It doesn't work like that. Example - MySQL: Thread 1 - SELECT * FROM blah WHERE etc=somefield; Thread 2 - SELECT * FROM blah WHERE blah=abcd; In this case, Thread 1 will take more memory and Thread 2 will take lesser memory, since the table 'blah' is already read into the memory, and the next thread will simple check in the pool if that table is open and blah blah. So you see all threads don't take same amount of memory.... another example: Thread 1 - SELECT * FROM table1 WHERE blah=etc; Thread 2 - SELECT * FROM table2 WHERE blah=etc; table1 might have proper indexes while table2 doesn't, that means Thread 1 will end first (assuming the records are same and 10000, for example (to use indices)) and thread 1 will also take less memory compared to the second which needs to loop through the complete table. Now comes a cute query: 'blah' is indexed (as well as 'etc') and this query is HEAVILY used (say, through ALL pages to identify visitor or something!). Thread 1 - SELECT etc FROM table1 WHERE blah=$SOMEVAR; Thread 2 - SELECT etc FROM table1 WHERE blah=$SOMEVAR; . . . Thread 1000 - SELECT etc FROM table1 WHERE blah=$SOMEVAR; It won't take 1mb of memory for each thread! : : FN>> Having 256 threads doesn't mean that it will take up too much : FN>> memory, what if if 255 threads are just ... sleeping? ;-) : : If 250 threads were sleeping, why MySQL should spawn 251-th? It should : just wake up one of sleeping ones, and I'm pretty sure that's what it : does. Just a general example, why would the threads sleep? ... I was just giving example that all threads do NOT take up same amount of memory. Enjoy!

« previous php.version4 (#12152) next »