help with pinpointing the speed problem

Hi,

I had a pretty slick setup of Ubuntu 12.04.4 with Wordpress on board.
I also have enabled xcache (128 permanent / 64 variable)and it was working great for some time.

in the past PHP application response time was around 200ms-250ms (new relic).
But because I had some problems with posting - after publishing a post - website would stop responding for 6 -10 seconds I implemented following changes:
http://www.virtualmin.com/node/32633

problem with posting is gone, when I post now, site does not return error.

But, what I am seeing now is response time of cca. 500ms (new relic).
In the past I had a day when I could serve 600 concurrent users, now only 250, after that response time goes to 15k ms, site stops responding)
I don’t know how can I check what is going on, where to look at.

There are 3 things that changed.

  1. Settings above
  2. Additional/different plugins / (about 20 total, tried to cancel some, but I need them all)
  3. More visitors - in the past I had cca. daily 100-200 users, now about 700-800 daily

I am on Digitalocean, 1cpu, 1GB ram.
I don’t think that this plan is a problem for one Wordpress website.
Do you think that upgrading to bigger 2cpu, 2gb ram plan would solve my problems?
What about Nginx? would that solve my problems?

Thanks

With “600 concurrent users”, do you really mean that 600 people accessed your site at the same time? That would be very VERY many, and I have strong doubts that your 1 GB system could handle that.

I’d suggest to first disable your plugins (even if you say you need them), to find out if they are responsible. You need to find that out, and the only way to do that is testing the changes you made step by step.

1 GB of memory can be too little, depending on what else you do with the server (spam and virus scanning e.g.).

nginx does not improve PHP performance, so will likely have no effect in your case.

You can use the tool atop to find out which process needs how many resources.

well, it was more like 680 something users, looking at real time analytic, and from then on, it was cca 500 constant connections for about an hour or so.
And yes, 1gb server did handle the load.

You were right, one of the plugins was the problem - broken links checker.
doughhhhh, stupid me, didn’t thought of that.

I read a week ago one post, where one super duper admin said that it’s possible to create tempfs in RAM and place php cache there - well something along this lines, I am not a linux expert so It may place wrong words in that sentence and that you could really optimize wp to handle many users without a problem.

I also read that Varnish could help with load, that you could server many time more users than without.

I am thinking about upgrading the server to 2 cores and 2gb ram, would that make it possible to have 1300 concurrent users?

Howdy,

How many users your server can handle is largely dependent on the application… however, doubling the RAM and cores doesn’t necessarily mean you would be able to double the users… 1300 concurrent users is a heck of a lot :slight_smile:

You’d probably need to do some testing – fire up a test system with the amount of RAM and CPU’s you’re looking to use, and run some benchmarks against that system to see if it handles the load you’re after.

Things like Varnish can indeed help with the load.

Memcache can also help too, as it reduces how many hits your application would need to make on the database.

-Eric

Yes, it highly depends on what those 600 or 1300 users do. If it’s just “idle” TCP connections, no problem. If 1300 users actually request PHP pages at the same time, your CPU will grind to a screeching halt. Like Eric (and yourself) said, you’ll need caches for PHP code, static page caching and database caches for that. And a lot of memory and a fast HDD.

You mentioned 800 users daily: That’s not a problem even for a very slow system. But all of them at the same time: Big time optimizations and caching required.

I am really looking forward Ubuntu 14.04.
I have installed Xcache 1.3 or something which is default for U12.04.
I was a bit sad when I discovered that all applications are not upgraded to the latest version I think Xcache is now at version 3. Also PHP is at 5.3.

Problem is that I don’t have the knowledge to compile latest versions…

Would you know how much Xcache memory is enough for this load?
I have currently enabled 128MB, should I increase it to 256? will that help? for more users?

Or should I try with Memcache?

If those “more users” request mostly the same pages, you don’t need to increase your cache size. :slight_smile: Once the most often used stuff is in the cache, it’ll be served from there, no matter how many users request it.

If the increasing amount of users means though that a greater variety of PHP files will be requested, increasing the cache can help. It’s next to impossible though to say how much memory you need, without seeing your concrete system for ourselves.

XCache comes with a management web interface that can show the amount of cache used, what’s in it and stuff. That might help you to set it up for your needs.