Register or log in (lost password?):

Low End Talk

Hosting Websites on Bare Minimum VPS/Dedicated Servers

Low End Talk » Low End Talk

Heavy memory usage and sporadic page generation time

(11 posts)
  1. Ellimist
    Member

    Hello,

    I have a 256 MB OpenVZ based VPS running on Ubuntu Lucid hosting a low traffic (~1000 pageviews per day) phpBB forum. The software packages I've installed are nginx, php5-cgi, mysql-server, php5-mysql, php5-xcache, and imagemagick. I've optimized MySQL so that it takes 10-15 MB memory at a given time (my my.cnf). It's php-cgi that starts around 8 MB and goes on till 30-40 MB until it is recycled(I have PHP_FCGI_MAX_REQUESTS set to 500). PHP-CGI is started with 1 child process. The total memory usage, at a given time, hovers between 95-110 MB.

    My pages load within 0.1 to 0.7 seconds, which is quite high IMO. But sometimes, one odd page takes more than 5 seconds to load. I'm not sure what's the cause of this, though.

    Files for reference :

    Posted 1 year ago #
  2. LowEndAdmin
    Key Master

    Would that be the same page taking over 5 seconds to load (that usually takes 0.1-0.7 seconds)? When the page takes a long time to generate, does the load goes up? Also how do you calculate the page generation time -- from browser's point of view or from phpBB?

    Also I noticed that you only have PHP_FCGI_CHILDREN=1 -- that means when one request is taking the PHP, another request will have to wait. Although I am not sure whether it will increase the page generation time by that much.

    If the load goes up -- check vmstat or top to see whether the CPU is blocking on IO.

    Posted 1 year ago #
  3. Ellimist
    Member

    Yes, the same page that took 10 seconds to load 5 minutes ago, just loaded in 0.267 seconds. The page generation time is calculated both from the broswer and from phpBB, and they generally concur.

    When the page takes a long time to generate, does the load goes up?

    I'm not entirely sure how I should find that out. I kept top running and there wasn't any significant change in load average when the page took 10 seconds to load.

    Also I noticed that you only have PHP_FCGI_CHILDREN=1 -- that means when one request is taking the PHP, another request will have to wait. Although I am not sure whether it will increase the page generation time by that much.

    I increased the number of child fcgi processes to 3 and (may be coincidentally) those random hangups seemed to have lessened. I still get page generation times of 3 seconds, but they are less frequent.
    However, the memory usage has shot up to 153 MB, which is what I want to lessen. :(

    Posted 1 year ago #
  4. Ellimist
    Member

    Scratch that. The hangups are still happenning.

    Posted 1 year ago #
  5. LowEndAdmin
    Key Master

    With top you can see where the CPU is spending its time. Only two suspicions that I have

    - wa goes up so the VPS is dying/slowing down on IO.
    - none of sys/usr/wa goes up, which means your VPS is throttled or limited by other VPS on the same box.

    Sorry not really helping. Unless you can trace through the execution path of that page to see which function is taking the time.

    Posted 1 year ago #
  6. a2787382
    Member

    Ellimist: From which company you bought the vps?

    Posted 1 year ago #
  7. Ellimist
    Member

    Never mind. That node was oversold. I moved to another VPS provider and the same pages load under 0.05 seconds, with no freeze-ups of any kind. The irony is, I moved from an 8-core Xeon to a Core 2 Duo and my pages load faster.

    @a2787382 : My previous provider was BuyVM. With too good to be true plans. I don't blame them though. You get what you pay for.

    Posted 1 year ago #
  8. earl
    Member

    I have noticed that if you have a high spec server they tend to be overcrowded so the performance is actually worst than if you were on an older machine..

    But BuyVM was pretty good for me they give you equal share to all 8 cores and iowait was not that bad.. just to test I actually went over my allocated 256mb and is using 400MB for a couple of days to see if my webpage would still load and it's working fine on burst ram no failcnt on user bean counter..

    Maybe it was just the node you were on..

    Posted 1 year ago #
  9. LowEndAdmin
    Key Master

    It's probably because "guaranteed" is only guaranteeing that your process won't be killed during an OOM. But for most Linux setup, by the time you hit OOM the server is probably already dead in the water. That's why I am always wearying of providers giving away high amount of burstable memory.

    Posted 1 year ago #
  10. a2787382
    Member

    @Ellimist which plan do you now have on RamHost?

    Can you post a "free -m", a "w" and your current configurations?

    Posted 1 year ago #
  11. Ellimist
    Member

    Sorry. I don't check this thread often.
    I'm on their "Micro" plan with 192 MBs of burstable memory.

    free -m
                 total       used       free     shared    buffers     cached
    Mem:           192         78        113          0          0          0
    -/+ buffers/cache:         78        113
    Swap:            0          0          0

    With a 32 MB xcache.size, 1 phpBB forum, 2 wordpress blogs, 1 static and another PHP based site, my memory usage hovers around 70-80 MB.

    w
     11:39:40 up 6 days,  2:39,  0 users,  load average: 0.00, 0.00, 0.00
    USER     TTY      FROM              LOGIN@   IDLE   JCPU   PCPU WHAT

    Had a slight (~3 minutes) downtime 6 days ago.

    I'd highly recommend RAMHost to everyone.

    Posted 1 year ago #

RSS feed for this topic

Reply

You must log in to post.