1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

High server load :(

Discussion in 'XenForo Questions and Support' started by Ray, Mar 20, 2011.

  1. Ray

    Ray Active Member

    I have noticed that my vps has been running slow lately.
    I don't want to blame Xenforo, but when the other software was installed, I could have 400 users online at a time and the Server load would stay at <= 0.20, Memory used(usage) at 0.25% and Swap Used at 0.27%-0.30%, max 0.35%

    Current figures:
    cpu.png

    The last time my vps was under such load was when I was running vbseo, which I had to get rid of and I don't want to get rid of xenforo but I will if I have to.

    The load has been consistent and since I switched to Xenforo, the highest amount of visitors at one time has been 120-130. So far I have disabled "search" for everyone ... I'm thinking the .htaccess rewrite may have something to do with it.

    Any suggestions?
     
  2. dutchbb

    dutchbb Well-Known Member

    Why do you consider that load to be a problem though? Our site is constantly at 1-3 and it poses no problems. Have you tried disabling 'Full Friendly URLs'?
     
  3. Walter

    Walter Well-Known Member

    Your biggest problem seems not load (1.5 is fine for all recent CPUs) but that you are using so much memory. 50% swap usage is not good.
     
    Kier likes this.
  4. Ray

    Ray Active Member

    I consider it a problem because when doing template edits, it takes forever for the "All templates saved successfully" message to appear. Even when hovering over the "Alerts" button, the loading bar just takes forever. Right now there are about 102 users and the load is very high, I mean there used to be about 400 users when I was running vb and the load wasn't even half of that now.

    Too much trouble to disable the URL rewriting just like that(lost half my traffic). If I have to disable URL rewriting, I'm certainly moving back to vb(no converter available xD).
    cpu2.png

    ... that's with less than 150 people online and search disabled.. imagine 400, I wouldn't be able to reach that, vps would crash and site would go offline.

    and here is how to lose traffic :D

    visits.png
     
  5. Ati

    Ati Active Member

    The thing I don't get is the green check sign in the "Swap user: 63.11%" line. If ANY swap is used, it's a bad-bad thing. It should use memory, not disk. Using swap slows down the entire system to a crawl.
     
  6. Deebs

    Deebs Well-Known Member

    Actually using swap is not a bad sign. It can also be that a process which is sat idle in memory has had some of its address space swapped out so that other processes can benefit from having access to the freed up memory.

    If you have swap being used then use vmstat and see if any blocks are being being actively swapped in or out, if not, the system is not under any memory pressure.

    As an example, my SQL server has 14gb of ram, 8gb free, yet I have 200mb used in swap. :)
     
    Blandt and Kier like this.
  7. Kier

    Kier XenForo Developer Staff Member

    Two of the things you cite as problems are intentional design decisions intended to speed up XenForo.

    Firstly, saving templates does indeed take a long time. That's because we prefer to do a major compilation process at save-time in order to save masses of processing at runtime. While this makes it slower for the administrator to edit templates (which is a relatively rare event compared to viewing front-end pages), the trade-off is that the front-end is extremely fast for your visitors all the time.

    Secondly, XenForo is optimised for a large amount of server memory. It's far cheaper to throw some more RAM into your server than it is to upgrade the disk system or the CPU.

    As various people have noted, it would appear that your server is struggling for memory and dumping data into swap. If you can't put more memory into your server, a simple way to have XenForo use less memory is to remove all unnecessary styles and languages.
     
    Walter likes this.
  8. Ray

    Ray Active Member

    cpu3.png

    I'm not liking the server load, any suggestions?
    (My host said something about 2.90 being perfectly fine, but it shows the red mark so I'm a bit skeptical)
     
  9. Martyn

    Martyn Active Member

    are you sure your website isnt under stand, check logs, check apache logs!.... check apache logs and see what how many users connected and whati p if the same one...

    recently a website on my VPS got attacked by google... google just flooded it with 5k hits within an hour, and shut the site down! i had to deny all robots for a few hours. and it eventually calmed down..
     
  10. Ati

    Ati Active Member

    If google is flooding you, you can set it to slow down with the crawlers under Webmaster Tools.
     
  11. hescominsoon

    hescominsoon Active Member

    60% ram usage is bad. It means you are using hte disk actively as ram and your system performance is going to crater.
     
  12. Deebs

    Deebs Well-Known Member

    60% "swap" usage can indicate memory pressure. It still doesn't mean that system performance is going to be bad, example, how do you know if swap is on disk or using an SSD?

    My original post was just correcting a misconception that using any swap is bad for a system.

    Back on topic, Ray, do you have shell access on your VPS?
     
  13. hescominsoon

    hescominsoon Active Member

    That's a matter of opinion NOT a mosconception. I've never had a system perform badly when using zero swap in term of ram induced problems but i've ALWAYS had a machine perform badly using that much swap. Besides using swap on a SSD just kills the SSD much faster and in small 4x writes unless it's a high end enterprise drive an SSD is actually worse than a mechanical hdd when writing many small files..or even big files if the controller isn't decent.

    Back to the thread...
     

Share This Page