Should the site slow right down and be unable to connect once 90% of RAM is used?

HJW

Active member
My site had a spike this morning larger than normal (1000+ people as reported by google A). It begain to slow down and some pages it just said couldn't connect to the site.

Should this have happened for 4gb and 2 cpus on digital ocean VPS? The site didn't go offline, but I did update it to 8gb of ram, by the time the site came back online the spike was gone so couldn't test it.

On XF 2.1 and thought there was better guest caching? Or is there more I need to do to stop a spike of guests bringing down the site?
 
The CPU usage didn't go up that high during the spike - 10% used. It was the memory that was close to being out.

Ok thanks will update it, it's a shame that the spike only happens infrequently (usually 300-400 max people) and caching pages for visitors would resolve it
 
8 GB4 vCPUs50 GB5 TB$80/mo
$0.119/hr

Should be enough.
When spike happens again.
Thanks, where is that option? I have these two that are half the price but one has way less disk usage - the other way more

8 GB 4 vCPUs 25 GB $40/mo $0.060/hr
8 GB 4 vCPUs 160 GB $40/mo $0.060/hr
 
Ah I see those are the CPU Optimized Droplets, didn't realise XF needed something that powerful!
 
If you want to handle higher loads with less memory, and its using Apache, turn off KeepAlive or set its timeout very low (5 seconds). With Apache, high keepalive values will cause those connections to wait until they time out and they sit there consuming memory.

I've set up systems with fewer resources than what you listed but with more simultaneous visitors. It is really a matter of changing a few settings to optimize things a bit.
 
Nginx will solve your problem and keep you from having to upgrade and pay more for servers.

Edit: I assumed you were using apache. If not, what is your server configuration? Caching is key as well. Was it to a single page? If so, try using Cloudflare and just caching that page for guests for 30 minutes. Lots of ways you can keep from investing in larger servers and still have good performance.
 
  • Like
Reactions: HJW
^^^^This, or OpenLitespeed.

But if he's sticking with Apache, that server can handle it if properly configured. I ran a forum with millions posts, up to 2000 registered users online at once, on a 4GB machine produced 15 years ago that had slow (compared to now) hard drives, and 4 gb of RAM. It's doable. CPU load was rarely an issue, memory footprint was (leading to high IO waits due to swapping).

When RAM is the limiting factor on an Apache system, turning off keepalive can often reduce its memory footprint by an order of magnitude during peak visits. Response time will increase slightly during these times, but the server will be able to handle many more people connecting without giving them blank pages due to a lack of connections.

Also, disable any php and Apache modules not being used, and things like reducing buffer sizes used only by MyISAM tables since Innodb is used by XF. In Apache, also set maxrequestsperchild to a reasonable value between 500 and 1000, as Apache's memory footprint grows over time. Change mod_deflate's compression value to 2 as well. And make sure your .htaccess file has caching directives turned on for CSS, JS, and images. If you can, move your .htaccess rules into your <Virtualhost section. This will eliminate a file load and parsing overhead for each HTTP request.
 
Nginx will solve your problem and keep you from having to upgrade and pay more for servers.

Edit: I assumed you were using apache. If not, what is your server configuration? Caching is key as well. Was it to a single page? If so, try using Cloudflare and just caching that page for guests for 30 minutes. Lots of ways you can keep from investing in larger servers and still have good performance.
Thanks looks like it shouldn't be that difficult to switch over to nginx. I'm just using a digital ocean lamp stack.

I used apache as used to setting it up before and couldn't decide between nginx and openlightspeed.

Looks like I need to change things now its getting a decent amount of traffic.
 
So far as which to go with (Openlitespeed or Nginx):

They have similar performance - depending on the usage one will do slightly better than the other in benchmarks, and both claim to be the fastest. Unless you're getting into seriously high connection situations (which this isn't) where one might be a better pick for the usage, go with the one you'll find easier to manage. If you prefer CLI, Nginx. If you prefer a browser interface, Openlitespeed.

If you need custom redirects or other custom processing done, and you're not familiar with Nginx, Openlitespeed will be more familiar since it supports the same .htaccess syntax.

Personally, I use Nginx but I prefer administration from a command line.

Either will do what you need.
 
Back
Top Bottom