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

Got a VPS, and Installed nginx, using nginxcp on Cpanel, whats next?

faeronsayn

Well-known member
#1
Okay I've just installed nginx using this addon for cPanel/WHM, nginxcp it installed fine and it seems like nginx is running as well. But my server load is still high and I have no idea on how to optimise this VPS. I was on shared hosting before and my site was pretty fast, now that I've moved to a VPS, it seems that my site is even slower than before.

There has to be a problem that I haven't solved, the CPU load is always around 1.6 or so, I need to lower it down some how. I usually have around 150 people on the site at a time, only 20 - 30 of them are members.

Anyways, I have no idea on how to customize nginx, and also for some reason it seems like Apache is still running and that nginx is maybe working side by side with it. I have no idea, but if two webservers are running at the same time, i am sure that isn't a very good idea, please help me with this. I've tried some caching options, i've done the file caching but thats it. I've heard of memcache but I have no idea on how to actually get that installed on my VPS.


So please, If anyone could help me customize / use nginx properly, as well as good caching and optimizing tips. It would be great!
 

Liam D.

Active member
#2
How many sites are hosted on the server? Also, how much RAM and CPU are we talking about? You can provide us with the common specs so some webmasters can take a look ;)

Anyway, try turning off un-needed services, and try tweaking your my.cnf file. For caching in xenForo, I use APC on my site and it loads 70% faster than normal (like its hosted on localhost). Here's a guide on how to do that: http://xenfans.com/threads/tip-use-apc.94/
 

faeronsayn

Well-known member
#3
How many sites are hosted on the server? Also, how much RAM and CPU are we talking about? You can provide us with the common specs so some webmasters can take a look ;)

Anyway, try turning off un-needed services, and try tweaking your my.cnf file. For caching in xenForo, I use APC on my site and it loads 70% faster than normal (like its hosted on localhost). Here's a guide on how to do that: http://xenfans.com/threads/tip-use-apc.94/
I'd probably have to get APC installed right ?


Also my server specs are the following

1gig of ram
2gig burstable
3 shared cores running at 3.2ghz
60 gig hard drive


Any help with nginx / apache would be great.
 

Liam D.

Active member
#4
Hm.. It's been awhile since I've used cPanel, and I am using NginX, only without a control panel. I managed to install APC by yum install pecl-php-apc (or something like that, forgot the exact package name). There is no guarantee that it can work for you though.

Also, about your CPU issue, I don't get what's wrong. I had exactly the same server specs before when I had my cPanel server and while it was hosting 70 websites at a time, its load was at about 0.80 at peak.
 

faeronsayn

Well-known member
#5
Hm.. It's been awhile since I've used cPanel, and I am using NginX, only without a control panel. I managed to install APC by yum install pecl-php-apc (or something like that, forgot the exact package name). There is no guarantee that it can work for you though.

Also, about your CPU issue, I don't get what's wrong. I had exactly the same server specs before when I had my cPanel server and while it was hosting 70 websites at a time, its load was at about 0.80 at peak.
I am only hosting 2, 1 is my main website, and the other is just for development.

Not sure why the site is so slow though.

Server load is around 1 - 2

I've heard with nginx it would usually be around 0.10 - 0.50 but its always very high for me.

It could be because nginx and apache are running, although i only want nginx.
 

Liam D.

Active member
#11
Ah I see. Well, I would guess that that is a busy forum you have there. Nevertheless, it shouldn't be having that big of a CPU appetite. I'm not quite familiar with cPanel working on NginX, but I THINK this has something to do with php-fpm. I'm not 100% sure on that though, 'cause I never had NginX on my cPanel servers. I guess you'll have to wait for others to answer here, sorry, can't help that much :p
 

faeronsayn

Well-known member
#12
Ah I see. Well, I would guess that that is a busy forum you have there. Nevertheless, it shouldn't be having that big of a CPU appetite. I'm not quite familiar with cPanel working on NginX, but I THINK this has something to do with php-fpm. I'm not 100% sure on that though, 'cause I never had NginX on my cPanel servers. I guess you'll have to wait for others to answer here, sorry, can't help that much :p
is it better to have nginx work on its own, and not be affliated with cpanel? Cause I only have cpanel for ease of use.

I barely use it, its just a lot easier to navigate through when doing backups and things like that, phpmyadmin and all that.

If its possible to run nginx, phpmyadmin, and all other necessary things without cpanel to run xenforo, easily. I wouldn't mind that.
 

Liam D.

Active member
#13
I run NginX on my server without a control panel. It works wonders, it saves me alot of RAM. But the thing is you need to know alot of server stuff to get things right, 90% of the time.
 

Jesepi

Well-known member
#14
If I remember right, the nginx mod for cpanel is only for handling the serving of static pages, while apache/mod_php is still used for serving php. That load seems to be pretty high for what traffic you are seeing and the hardware you have.

Have you checked your easyapache config to be sure that apc cache is installed with php?
 

Liam D.

Active member
#15
Just like Jesepi said. NginX serves static pages (like HTML). At the end of it, cPanel's Apache installation still serves the server-side.
 

faeronsayn

Well-known member
#16
Okay i've got APC installed and all that...

Just having a problem now.

For some reason my site always has "1" guest.

When usually it has 100 guests +
 

Liam D.

Active member
#17
Check mbstring and mhash if they are configured properly for PHP. To test out, make an info.php and put this line of code:

PHP:
<?=phpinfo();
mbstring and mhash should be there. If it is still there and the problem still exists, try doing a rebuild via the xenForo Admin CP.
 

Gene Steinberg

Well-known member
#20
I have two silly questions: Isn't nginx more attuned to static rather than dynamic content? How about sites with .htaccess content? That's not supported with nginx right?