Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
 Post subject: Linode 768 and LAMP
PostPosted: Wed Mar 16, 2011 8:37 am 
Offline
Junior Member
User avatar

Joined: Mon Mar 02, 2009 10:45 pm
Posts: 38
Three years ago when I first got my Linode, I got the lowest tier (which I think was 256MB at the time). I tried to get a LAMP stack going but I couldn't figure out how to tweak it such that it wouldn't constantly run out of memory and crash.

I admit that it could have been that I just didn't know what I was doing, but I eventually opted for Lighty and have had no problems with memory since.

I'm about to move over to a larger Linode (768) and I'm interested in trying Apache again. My Linode runs a web server that gets about 5000 hits/day.

With the addition of these Stack Scripts, can I assume that using the LAMP script I can expect to get good performance on the newer linode? Or am I better off sticking with Lighty?

(The prevalence of Apache rewrite rules over Lighty makes it preferable for the software packages that I'm running.)


Top
   
 Post subject:
PostPosted: Wed Mar 16, 2011 8:52 am 
Offline
Senior Member

Joined: Sun Mar 07, 2010 7:47 pm
Posts: 1970
Website: http://www.rwky.net
Location: Earth
5000 hits per day is around 3.5 per minute, apache, lighty, nginx can all handle that without even blinking.

The LAMP stack script (http://www.linode.com/stackscripts/view ... criptID=10) will tune apache for you and you'll be fine.

Also a 512 can easily handle 5000 h/p/d.

_________________
Paid support
How to ask for help
1. Give details of your problem
2. Post any errors
3. Post relevant logs.
4. Don't hide details i.e. your domain, it just makes things harder
5. Be polite or you'll be eaten by a grue


Top
   
 Post subject:
PostPosted: Wed Mar 16, 2011 8:54 am 
Offline
Junior Member
User avatar

Joined: Mon Mar 02, 2009 10:45 pm
Posts: 38
Thanks. I've never used the stack scripts so I didn't know if I could expect it to be tuned up for my Linode or not. I assume that it properly tunes not only Apache, but also MySQL?

I'm moving to the 768 because I regularly use more than my allotted 200GB/month transfer (lots of images). Rather than paying the overage for the extra 100GB or so that I use every month, I figured I might as well upgrade everything else for the same price.


Top
   
 Post subject:
PostPosted: Wed Mar 16, 2011 9:56 am 
Offline
Senior Member

Joined: Fri May 02, 2008 8:44 pm
Posts: 1121
Why do you want to move back to Apache if you've been running problem-free with lighty for three years? By your description (lots of images), it looks like an ideal situation for lighty to shine. Is there something you need that lighty can't deliver, such as per-directory .htaccess configuration or an Apache-only module?


Top
   
 Post subject:
PostPosted: Wed Mar 16, 2011 10:06 am 
Offline
Senior Member

Joined: Sun Mar 07, 2010 7:47 pm
Posts: 1970
Website: http://www.rwky.net
Location: Earth
The op said
Quote:
(The prevalence of Apache rewrite rules over Lighty makes it preferable for the software packages that I'm running.)


However I do agree lighty and nginx perform better on static files than apache but for the number of hits you're talking about I wouldn't worry about which server you run.

Yes the script tunes apache,mysql and php.

_________________
Paid support
How to ask for help
1. Give details of your problem
2. Post any errors
3. Post relevant logs.
4. Don't hide details i.e. your domain, it just makes things harder
5. Be polite or you'll be eaten by a grue


Top
   
 Post subject:
PostPosted: Wed Mar 16, 2011 10:27 am 
Offline
Senior Member

Joined: Fri May 02, 2008 8:44 pm
Posts: 1121
Quote:
(The prevalence of Apache rewrite rules over Lighty makes it preferable for the software packages that I'm running.)

Oops, missed that.

But is it actually so impossible to use that software package with lighty? I mean, you've been using it for three years just fine. Rewrite rules are setup-once-and-forget-it, so if you can find the right set of rules, you're done for the rest of the decade.

Also, you might want to look into nginx. It's often easier to translate Apache rewrite rules to nginx rewrite rules than lighty rewrite rules, because nginx natively supports more types of rules. Otherwise it's very similar to lighty.


Top
   
 Post subject:
PostPosted: Wed Mar 16, 2011 12:41 pm 
Offline
Junior Member
User avatar

Joined: Mon Mar 02, 2009 10:45 pm
Posts: 38
Though it was perhaps a bad choice, I chose Vanilla as my forum software. It's a relatively small userbase (the product itself I mean). I then upgraded to Vanilla 2. There were no lighttpd rewrite rules so I wrote them.

But they're not perfect and I can't figure out how to get some things to work. I have had little luck getting others to join me in the cause because the great majority of Vanilla users are using Apache.

I then chose Piwigo for an image gallery; again not widely used; again no Lighttpd rules for it. I wrote them myelf. Luckily, those have always served me well.

When looking for support for a lot of these packages, people don't know how or don't want to help because I'm not running on the "preferred" web server.

Could I stay with lighty and keep writing my own rewrite rules every time I install some new software? Sure I could. But why not switch to Apache and take one more thing off my plate?

But hybinet, are you ultimately saying that you don't think Apache will work as well for me? Because that was my original question. Certainly, if I can expect noticeable performance degradation, then I'll want to rethink using Apache.

.


Top
   
 Post subject:
PostPosted: Wed Mar 16, 2011 4:14 pm 
Offline
Senior Member

Joined: Mon Oct 27, 2008 10:24 am
Posts: 173
Website: http://www.worshiproot.com
Apache should be able to handle 3500 hits/day without breaking a sweat.

If you truly are serving a lot of images, you might be well served by putting something like nginx in front of Apache to serve the static content, and pass all the PHP stuff on to Apache.

Another option you might want to consider... If your primary need is more transfer, you could keep your existing 512 as your web server and move your database off to a separate 512. Transfer is pooled for all Linode's on your account, so you'd get a total of 400GB/month. The web server and db server would communicate over the private network, which doesn't count towards your transfer usage.


Top
   
 Post subject:
PostPosted: Wed Mar 16, 2011 4:27 pm 
Offline
Senior Member

Joined: Sun Mar 07, 2010 7:47 pm
Posts: 1970
Website: http://www.rwky.net
Location: Earth
A few other tips on saving bandwidth,

1) compress your content using mod_gzip or some other similar mechanism, it won't help for images since they're compressed anyway (unless you're using uncompressed images of course), but it will reduce other content

2) If your images don't change very often employ caching using mod_expires

_________________
Paid support
How to ask for help
1. Give details of your problem
2. Post any errors
3. Post relevant logs.
4. Don't hide details i.e. your domain, it just makes things harder
5. Be polite or you'll be eaten by a grue


Top
   
 Post subject:
PostPosted: Wed Mar 16, 2011 6:03 pm 
Offline
Senior Member

Joined: Fri May 02, 2008 8:44 pm
Posts: 1121
Lykaon wrote:
But hybinet, are you ultimately saying that you don't think Apache will work as well for me? Because that was my original question. Certainly, if I can expect noticeable performance degradation, then I'll want to rethink using Apache.

I didn't mean to imply that Apache would be bad for you. I was just wondering why you want to move from lighty back to Apache, because most people on these forums want to move the other way around. If anything, Apache increases memory consumption. Whether or not this matters depends on how much memory you have at your disposal.

With only 5,000 hits per day, any web server would work just fine, as long as you configure it properly. Do you know whether your image files are being served directly by lighty or through a PHP script? You can usually tell by looking at the URL of the images. If it's the former, you can get significant memory savings (and possibly performance gains) by staying with lighty or nginx, but since you have plenty of memory this might not be a concern. If it's the latter, switching to Apache probably won't change anything memory-wise.

Another option, as @JshWright said, is to put lighty/nginx in front of Apache as a reverse proxy. This setup has similar memory and performance characteristics as lighty/nginx with fastcgi, but you also get to play with fancy Apache rewrite rules. If you want to have the best of both worlds and don't mind having some fun tweaking things, try this.


Top
   
 Post subject: Re: Linode 768 and LAMP
PostPosted: Wed Mar 16, 2011 11:06 pm 
Offline
Senior Member

Joined: Fri Jan 09, 2009 5:32 pm
Posts: 634
Lykaon wrote:
I'm about to move over to a larger Linode (768) and I'm interested in trying Apache again. My Linode runs a web server that gets about 5000 hits/day.


On an absolutely insane day for my heaviest site, per awstats, I had 740k hits, 86k pageviews, mostly in a 4 hour period. This is a phpbb3 board. At that time, it was on a 360 (now 512), running apache mpm prefork with mod_php. ie, the heaviest possible way to do it. That said, if you're pushing over 200GB in only 5k hits a day, you're serving up way bigger files than I am (1.1GB used in that day).


Top
   
 Post subject:
PostPosted: Fri Mar 18, 2011 7:37 am 
Offline
Junior Member
User avatar

Joined: Mon Mar 02, 2009 10:45 pm
Posts: 38
Just as an update to this:

I went ahead with testing this out. I got a Linode and installed the standard LAMP stack script. I copied over my data and my sites and did some benchmarks with ab from my home computer (I have no idea if Apache's ab is a good way to get metrics).

In general, Lighty performs better by about 200 milliseconds pretty consistently as I ramp up the concurrent connections.

On the other hand, Apache was a breeze to set up with all my software. It was a lot easier to find guidance on the web about setting up expires headers, apc, etc.

So far, I've set up expire headers, enabled APC, and enabled super-cache for Wordpress. Apache is configured to use up to 40% of the RAM, and mysql gets 40%. Anything else I can do to squeeze out some performance from Apache (besides standing up nginx or Lighty for the static files)?

.


Top
   
 Post subject:
PostPosted: Fri Mar 18, 2011 7:59 am 
Offline
Senior Member

Joined: Sun Mar 07, 2010 7:47 pm
Posts: 1970
Website: http://www.rwky.net
Location: Earth
Have you enabled mod_gzip, it will ensure the super cache content is compressed saving you bandwidth and increasing speed.

_________________
Paid support
How to ask for help
1. Give details of your problem
2. Post any errors
3. Post relevant logs.
4. Don't hide details i.e. your domain, it just makes things harder
5. Be polite or you'll be eaten by a grue


Top
   
 Post subject:
PostPosted: Fri Mar 18, 2011 8:21 am 
Offline
Junior Member
User avatar

Joined: Mon Mar 02, 2009 10:45 pm
Posts: 38
obs wrote:
Have you enabled mod_gzip, it will ensure the super cache content is compressed saving you bandwidth and increasing speed.

Good idea. The super-cache addon has a checkbox for zipping the contents, but I'm not sure how it's doing it. If it's doing it via php, then mod_zip may be more efficient. I'll look into that.

Since I didn't enable mod_zip on Apache, I assume the super-cache plugin has no choice but to do it via php.

.


Top
   
 Post subject:
PostPosted: Fri Mar 18, 2011 11:34 am 
Offline
Senior Member

Joined: Fri Jan 09, 2009 5:32 pm
Posts: 634
Lykaon wrote:
Anything else I can do to squeeze out some performance from Apache (besides standing up nginx or Lighty for the static files)?


The other route you can go with Apache is to replace mpm prefork/mod_php with mpm worker/fastcgi.


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 2 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

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group