• Introducing WebPros Cloud - a fully managed infrastructure platform purpose-built to simplify the deployment of WebPros products !  WebPros Cloud enables you to easily deliver WebPros solutions — without the complexity of managing the infrastructure.
    Join the pilot program today!
  • Support for BIND DNS has been removed from Plesk for Windows due to security and maintenance risks.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS.

PHP Performance

A

awpti

Guest
Running into some performance issues.

I've tested this on both a default install (8.3 w/ PHP 5.2.4) and an install with a custom compiled version of PHP (5.2.5).

Running 'ab' on any domain on the server that generates dynamic content via scripting is HORRIDLY slow. I cap out at 12-13 requests per second. This is rediculously slow compared to other servers handling the same scripts at 300-400 requests per second.

What configuration setting should I modify to increase this performance? I've got full control over this box and I know apache/php inside out. I'm just lost as to why this is running like complete ****.

NOTE:

This is on a server with 0 load. I'm pre-benching it before going public.

This server is utilizing APC which brought it from a grotesque 3-4req/sec to 12-13 req/sec.. still not acceptable performance.
 
Please provide some details about your installation. Do you have php running as cgi ? Did you change anything except the php version ? a.s.o
 
Sorry for the late response;

Here's what I gathered:

PHP was running as a CGI. Flipped this back to running as a SAPI module - sucks, but I'll have to live with Apache taking ownership of files (I was utilizing suPHP).

MySQL is very tightly optimized. Query caching and all.

In any case, after flipping over to the SAPI module, it's running fairly well - 380ish req/sec off of a Celeron 2.0Ghz w/ 1G of memory. This server is running Fedora Core 7 w/ Apache 2.2.6, PHP 5.2.5 and mySQL 5.0.45.

Here's the mySQL config;

Code:
join_buffer_size = 16M
key_buffer_size = 256M
table_cache = 128
max_allowed_packet = 1M
query_cache_limit = 20M
read_buffer_size = 32M
read_rnd_buffer_size = 32M
sort_buffer_size = 32M

query_cache_type = 1
query_cache_size = 20M

And here is the relevant apache stuff;

Code:
Timeout 30
KeepAlive On
MaxKeepAliveRequests 200
KeepAliveTimeout 4

<IfModule prefork.c>
StartServers       10
MinSpareServers    20
MaxSpareServers    30
ServerLimit       512
MaxClients        512
MaxRequestsPerChild  4000
</IfModule>

I guess ~380req/sec isn't to bad, but it still feels sluggish. Second I disable WP-Cache, the site rolls down to <30req/sec handled.
 
Well, if you test a site, then my guess is that the site has some php code there that is messing with the server. Try ab on a simple html page and then on a simple php and tell us the difference. Also, do you use external content in the site you test ?
 
Back
Top