• Hi,

    For a couple of days I’m having trouble with with my VPS that runs some wordpress sites. Including a brand new WordPress installation with no plugins. This run on a VPS with the following specs:

    HARDWARE:
    1 Ghz CPU
    1 GB Mem
    60 GB storage

    SOFTWARE:
    Ubuntu Linux 10.04 LTS
    Plesk 10.4.4
    PHP 5.3
    MySQL 5.1

    In idle state the server uses no CPU power and only 500 MB Mem

    When I go the brand new installation the website loads in about 4-6 seconds (according to firebug addon in FF). When i look at the NET section is states that most of the loading time goes in the GET request. It’s stuck at “waiting” for about 90% of the loading time.

    So i looked into my VPS when logged in over SHH and used the top command to check the resources being used on a page request. I got the following results:

    PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
     5525 www-data  20   0  289m  43m 3788 R 57.8  4.3   0:02.22 apache2
     5537 www-data  20   0  295m  48m 4944 R 40.3  4.9   0:03.49 apache2
      741 mysql     20   0  245m  41m 7708 S  1.3  4.2   1:06.40 mysqld
     5533 root      20   0 19224 1352 1028 R  1.0  0.1   0:03.69 top
        1 root      20   0 23696 1848 1248 S  0.0  0.2   0:02.04 init

    I get this when i request the homepage of the fresh installed wordpress installation. The load drops when the page is fully loaded in the browser. I thought it was apache that was slowing things down but when i tested another domain on the VPS with just 1 page (HTML only) it loads instantly.

    It just get super slow once a database is involved. So I checked the process list in mysql and this is what I got when i requested the homepage of the WP site:

    Kill Kill     2169     testdb     localhost     testdb     Sleep     1         NULL
    Kill Kill     2171     admin     localhost     psa     Sleep     1         NULL
    Kill Kill     2172     pma_svlZ4MPjpe78     localhost     NULL    Sleep     0         NULL
    Kill Kill     2173     admin     localhost     NULL    Query     0     NULL    SHOW PROCESSLIST

    The top line gets added compared to the process list when the server is idle.

    I then switched on long query log and check mysql error log. But nothing strange appears in those files to me:

    mysql error log:

    120613 13:44:39 [Note] Event Scheduler: Purging the queue. 0 events
    120613 13:44:39  InnoDB: Starting shutdown...
    120613 13:44:41  InnoDB: Shutdown completed; log sequence number 0 33231029
    120613 13:44:41 [Note] /usr/sbin/mysqld: Shutdown complete
    
    120613 13:46:31 [Note] Plugin 'FEDERATED' is disabled.
    120613 13:46:33  InnoDB: Started; log sequence number 0 33231029
    120613 13:46:34 [Note] Event Scheduler: Loaded 0 events

    Long query log:

    # User@Host: debian-sys-maint[debian-sys-maint] @ localhost []
    # Query_time: 2.323276  Lock_time: 0.005684 Rows_sent: 0  Rows_examined: 5495
    SET timestamp=1339626814;
    select count(*) into @discard from <code>information_schema</code>.<code>COLUMNS</code>;
    # Time: 120614  0:33:36
    # User@Host: debian-sys-maint[debian-sys-maint] @ localhost []
    # Query_time: 1.989958  Lock_time: 0.130794 Rows_sent: 0  Rows_examined: 505
    SET timestamp=1339626816;
    select count(*) into @discard from <code>information_schema</code>.<code>PARTITIONS</code>;

    So i have no idea what is causing the delay when i work with wordpress websites. It seems the server is running into some timeout or something but i cant figure out whats casusing it.

    With a caching plugin like WP super cache, cached pages load super fast but non cached pages are still as slow as the rest. Same goes for admin pages they are also slow.

    I hope you guys might have a hint was going on here. Thx.

Viewing 8 replies - 1 through 8 (of 8 total)
  • Anything interesting in your httpd error log file?

    Also, have you moved a database from another server?

    Have you tried mysqlcheck? Or CHECK TABLE?

    The server should be adequate unless you get a lot of traffic, and I don’t see anything especially odd in what you’ve posted. You can probably get rid of testdb. I think that is created at install as a test of the system. Check to be sure. Unless you are using InnoDB you can disable it and save some resources.

    Thread Starter nyxium

    (@nyxium)

    I made the some website on my laptop and then moved them to server including their databases. But yesterday i created a fresh wordpress install directly on the server. And even that wordpress site is as slow as the rest. Locally they all work fine.

    Mysql check shows no errors (everything is OK) also apache error log doesnt show any errors that may give a hint to my problem. There is also 0 traffic on the server. Just when i visit a page of 1 of the sites, the cpu spikes up to 60-80% as long as the page is fully loaded in the browser (which takes about 4-6 seconds). Its just the GET request that is taking all the times.

    Its just the GET request that is taking all the times.

    Well, sure, it would be. That is what kicks everything into motion– Apache, PHP, and MySQL.

    Just when i visit a page of 1 of the sites, the cpu spikes up to 60-80%…

    “as long as the page is fully loaded”? Or while the page is loading? I’m assuming the later.

    Based on my own non-scientific experience, the fact that you are seeing 60-80% (in top?) for a single page load is odd. You might get that kind of hit but it should last microseconds. The chances of seeing it should be slim. I’d expect that kind of load for a lot of traffic, not just one request.

    I have been watching my VPS, which is live, and once in awhile something will jump to 50-60% but that is rare. Even watching it while webpagetest.org runs a test, to guarantee traffic at that instant, doesn’t show anything close to what you are seeing.

    Who hosts your VPS, if I may ask?

    Thread Starter nyxium

    (@nyxium)

    “as long as the page is fully loaded”? Or while the page is loading? I’m assuming the later.

    while its loading yes, the load drops when the page is fully loaded in the browser.

    Leaseweb hosts my VPS, I also let them know what was going on, they said apache probably needed some “Finetuning” but i think its a little more than that because i cannot find any clues about what is causing the load and long GET requests.

    edit: Traceroute doesnt show any problems also static (non wordpress/php/mysql pages) load instantly.

    Yes, let them ‘fine tune’. Ahem…

    In my experience, Apache behaves better than this right out of the box, even on crappy hardware. I tend to put my dev servers on oldest, slowest hardware I have to accentuate any poorly performing scripts, and this is pretty slow even by those standards.

    Thread Starter nyxium

    (@nyxium)

    It got fixed, they moved my VPS to another server and all performance problems are gone. Pretty strange cause that is not something i’d expected from such a big hoster, overselling there services.

    overselling

    Overselling, nooo….! Its called “thin provisioning”. 🙂

    Thread Starter nyxium

    (@nyxium)

    lol 🙂

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Standard wordpress website needs 4-6 seconds to load’ is closed to new replies.