PHP Developers Network

A community of PHP developers offering assistance, advice, discussion, and friendship.
 
Loading
It is currently Mon Dec 11, 2017 11:41 pm

All times are UTC - 5 hours




Post new topic Reply to topic  [ 10 posts ] 
Author Message
PostPosted: Mon Feb 16, 2015 8:54 am 
Offline
Forum Contributor

Joined: Fri Jul 18, 2014 1:54 pm
Posts: 170
Hi,

in about an hour I will be stepping through this VPS tutorial http://www.mckerracher.net/vps for my first time going from local host to a bare minimum starter VPS system to learn the ropes and to get a feel for whether my first and likely only website might fly. Hopefully by the end of the week I have not pulled all my hair out. Anyway, I am always thinking 5 to 10 years ahead and (while investigating setting up a server from my home, studying a bit about T1 lines and learning about co-location), I found this interesting link below about the advantages of using Nginx over Apache. What the author says interests me very much because my website will be process intensive and the speed at which pages comes up will be much more important than fancy jquery stuff (a minimalist website is my rule). I searched the forum for both VSP and Nginx and found nothing (on 2nd thought I did a browser search and should try again with a forum search). Regardless, I was wondering if anyone had any thoughts on my going the Nginx route rather than Apache with a low end VPS setup. I will say my first attempt at installing Apache failed because I got the version out of line with the Mysql version or PHP version (can't remember which) and I had to retreat to xampp to get through it (luckily I retained some hair in the process thanks to Xampp and some suggestions from the great people on this forum).

He touches on Apache versus Nginx in the 2nd paragraph labeled "The Web server".
http://arstechnica.com/gadgets/2012/11/ ... -server/2/

Thanks,
John


Last edited by bowlesj on Mon Feb 16, 2015 9:02 am, edited 1 time in total.

Top
 Profile  
 
PostPosted: Mon Feb 16, 2015 9:01 am 
Offline
Moderator
User avatar

Joined: Tue Nov 09, 2010 3:39 pm
Posts: 6402
Location: Montreal, Canada
I don't expect it will make a huge difference. Why not set up a VM with each and compare?

_________________
Supported PHP versions No longer supported versions


Top
 Profile  
 
PostPosted: Mon Feb 16, 2015 9:05 am 
Offline
Forum Contributor

Joined: Fri Jul 18, 2014 1:54 pm
Posts: 170
Thanks Celauran. That sounds like a good Idea. I have it on my to-do list. John


Last edited by bowlesj on Mon Feb 16, 2015 9:25 am, edited 3 times in total.

Top
 Profile  
 
PostPosted: Mon Feb 16, 2015 9:16 am 
Offline
Moderator
User avatar

Joined: Tue Nov 09, 2010 3:39 pm
Posts: 6402
Location: Montreal, Canada
If you aren't already familiar with it, PuPHPet will make that task a breeze.

_________________
Supported PHP versions No longer supported versions


Top
 Profile  
 
PostPosted: Mon Feb 16, 2015 9:23 am 
Offline
Forum Contributor

Joined: Fri Jul 18, 2014 1:54 pm
Posts: 170
Thanks Celauran. Reading it now. By the way VPS itself is already set up for me (XEN technology).

Just to be thorough regarding Nginx, I found a link in the article pointing to more info on why the author switched from Apache to Nginx. I have not read it yet.
http://arstechnica.com/business/2011/11 ... for-nginx/


Top
 Profile  
 
PostPosted: Mon Feb 16, 2015 9:27 am 
Offline
Moderator
User avatar

Joined: Tue Nov 09, 2010 3:39 pm
Posts: 6402
Location: Montreal, Canada
Oh, the PuPHPet link was just for help in getting virtual machines set up locally.

_________________
Supported PHP versions No longer supported versions


Top
 Profile  
 
PostPosted: Mon Feb 16, 2015 9:38 am 
Offline
Forum Contributor

Joined: Fri Jul 18, 2014 1:54 pm
Posts: 170
Quote:
Oh, the PuPHPet link was just for help in getting virtual machines set up locally.

Okay, understood. thanks.


Top
 Profile  
 
PostPosted: Mon Feb 16, 2015 9:56 am 
Offline
Forum Contributor

Joined: Fri Jul 18, 2014 1:54 pm
Posts: 170
Reading this quote below from the first page of this link http://arstechnica.com/business/2011/11 ... for-nginx/ suggests that maybe Apache is the way to go since my website is highly dynamic (95% of none help pages go after the database with a few functions doing multi-pass work).
Quote:
Nginx particularly excels at serving static files—like the Tectonicus map tile images. For larger websites, it's often employed as a front-end Web server to quickly dish up unchanging page content, while passing on requests for dynamic stuff to more complex Apache Web servers running elsewhere. However, I was interested in it purely as a fast single Web server.

At the same time this extract from the same link above suggests that maybe I should try to get "Apache MPM worker" installed but will PHP handle it as I add more to the quote and underline the concern?
Quote:
The drawback to doing everything with processes is that Apache prefork can be a bit of a memory hog, especially under load. Another precompiled flavor of Apache can be installed as an alternative: Apache MPM worker. "Worker" differs from "prefork" in that worker's processes are multithreaded, giving them the ability to service more requests with fewer system resources. This can translate into faster pages served with less RAM and CPU. However, because some Apache modules don't necessarily work well when run under multithreaded Apache, you have to specifically select this version to install on Ubuntu and on other GNU/Linux distros with package management.
A bit of searching showed that Apache worker could go a long way toward making Tectonicus serve its tons of tiles faster, but switching would cause some issues with PHP. The built-in Apache PHP module, "mod_php," is one of those modules that can have issues running multi-threaded. I was faced with quite a bit of software ripping and replacing to switch from mod_php to a standalone PHP.

Still reading! It looks like they have worked around the PHP issues - maybe ????. Like you suggested Celauran. Trying both may be wise.

So the reading is done. It sounds like Apache is the way to start with a consideration of using Nginx as a way to maybe speed things up later.


Top
 Profile  
 
PostPosted: Mon Feb 16, 2015 11:39 am 
Offline
Moderator
User avatar

Joined: Mon Nov 03, 2003 7:13 pm
Posts: 5978
Location: Odessa, Ukraine
mod_php could indeed have issues under multithreaded environment like Apache's worker mpm. You could opt to set php as FastCGI - this way you could safely use any apache's mpm (or even nginx). In fact, under nginx FastCGI is the only sane option to run PHP (without resorting to apache).


Top
 Profile  
 
PostPosted: Mon Feb 16, 2015 12:41 pm 
Offline
Forum Contributor

Joined: Fri Jul 18, 2014 1:54 pm
Posts: 170
Thanks Weirdan. I am going to start that initial tutorial and when I get to the Apache/PHP stage get back to the type of Apache mpm decision. I will be using the Webmin Virtualmin GPL on CentOS. I gather Webmin Virtualmin has a bit of a learning curve so it may be a little while before I get to the Apache/PHP stage. Not only that, being away from Lunix for 14 years I will probably be doing a bit of catch-up on the basic things. John.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 10 posts ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 5 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group