[development] 2k qps

Amr Mostafa amr.mostafa at gmail.com
Wed Oct 11 08:27:54 UTC 2006


> Check  if the number of Apache processes is too high (e.g. 256 which
> may not fit in your RAM without swapping), and lower it if necessary.

Regarding this, what I do is watch the process table, see the average
memory footprint for each apache process, let's say it's 6 mb. You
have 1000 mb, leave some RAM for mysql and other services, so
remaining is 600 mb (just an example). 600/6 = 100. And that's the Max
apache processes I will be allowing. Because more than that it means
my apache will swap.

If your theme has lots of images, consider tweaking your Keep-Alive
(http://httpd.apache.org/docs/1.3/keepalive.html) and cache
(http://www.mnot.net/cache_docs/), it will help save unnecessary
apache processes. Also, consider serving your non php files under
thttpd (http://www.acme.com/software/thttpd/) or another light web
server.

Consider moving your rewriting rules to to conf files instead of
.htaccess, due to way rewriting works, it internally resets part of
the request processing cycle when invoked too late (e..g via
.htaccess) while having it in conf files enables it to take action
early enough.

Consider removing your .htaccess completely, move the configuration to
.conf files, and disable .htaccess in apache conf. This will save you
a few system calls.

If your site is a community one that gets updated a lot, consider
turning off query cache for some tables. Because in that case, cache
becomes invalid in very short intervals and maintaining cache becomes
overhead.

No one sugguested a Drupal performance tip. I will kick the ball off,
it's a bit nuts, might break things but this is the devel list right ?
I find many sites not using Drupal's aliases feature. If you are one
of those, consider turning off aliases lookup. I do this quickly by
adding return FALSE in first line in
(http://api.drupal.org/api/4.7/function/drupal_lookup_path). This will
save you some queries.

Of course you will want to benchmark all that and see what works best for you.


More information about the development mailing list