1

We have two GoDaddy servers storing a Facebook application. One is for testing and the other is for production. Both have the same code, but the test server responds much faster.

Both servers configurations are:

  • OS: Centos 5.3
  • PHP: 5.3.1
  • MySQL: 5.5.21

And they both have the same hardware.

We are trying to trace the problem, first we've tested our code by monitoring the usage of our php&mysql usage percents by top. We've manage not exceeding 10%. I'm reminding that both servers has the SAME code.

Secondly, we've changed the MySQL configuration file at the production to be exactly as the testing server, but this didn't help either.

As we tested our application with firebug, we've discovered a lot of lag in some .php files. Some .php file requests take 2 seconds on the testing server and 13 seconds on the production server. As this lag persisted ONLY in the production server, we've compared the result of both of the phpInfo() results.

The differences can be seen here:

Differences from phpinfo() results

Every difference is listed in this form:

******Testing //A result from our testing server (Empty means not exist)

******Production  //A result from our production server (the SLOW one)
HTTP_CACHE_CONTROL

Do you see any differences that can cause performance issues ?

Thanks.

3 Answers 3

1

Are both servers up-to-date? There's obviously discrepancies in at least the PHP-Memcached version between the two boxes.

Failing that, could there possibly be a hardware problem? A broken RAID array or similar could cause slowdown in certain situations.

A possible way to debug the slowdown might be to run a sample PHP script (one which shows a speed discrepancy between the two servers) under strace, and then working out at what point the slowdown occurs.

2
  • Thanks, how can I changed the HTTP_CACHE_CONTROL settings ? I cant find it not on httpd.conf and not in php.ini.
    – Alon Adler
    Jun 7, 2012 at 13:17
  • You can change it in Apache via httpd.apache.org/docs/2.0/mod/mod_expires.html - but I'm not 100% sure where that's listed in your phpinfo() or at what stage that's being read Jun 7, 2012 at 14:33
0

This sounds a lot like locking. Are you using MyISAM tables? A write query to a MyISAM table locks the entire table which will cause any concurrent read request to have to wait until the write is finished. Since the only difference between the servers is the number of concurrent requests, this is my first guess. InnoDB has row-level locking for writes which makes it a better choice for that kind of read/write workload.

The MySQL query cache can also be a locking point as all entries for a particular table have to be flushed every time any write is made to that table. Larger query caches are not always better and can cause big slowdowns.

Do you have your MySQL slow log turned on? You might also want to add log_queries_not_using_indexes. Disk contention would be my second guess. The output of vmstat 5 5 should help determine this. (As always with vmstat, ignore the first line.) If this is your problem, you potentially can solve it by:

  1. Adding more RAM.
  2. Using faster disks such as 15k RPM or SSDs.
  3. Changing your app to require less writing.
  4. Caching your reads somewhere else such as memcached.

It's probably also worth running mysqltuner.pl on your MySQL server. To get it, just type wget mysqltuner.pl.

0

Have you contacted GoDaddy about this issue?

If you're certain that the Web stack is identical (MySQL config/Apache config/PHP/source code), then clearly there's a configuration issue at a level beyond your reach (network/disk/virtualization layer, assuming they're employing virtualization at GoDaddy; not familiar with their virtual private server offerings).

If it's just shared hosting (and maybe even VPSs, who knows; again contact Go Daddy) you never know what box you're going to get: I have a reseller account with another large hosting provider and I can tell, by IP, that I'm going to get a "dog" server, one with a ton of accounts on it (did a count of sub-directories in /home to prove it). Actually in general, shared hosting is pretty spotty performance-wise: I really only use it for 3-pager brochureware sites.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .