News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

My server configuration OK?

Started by Tiribulus, February 14, 2009, 09:46:27 PM

Previous topic - Next topic

Tiribulus

#20
Quote from: Phalloidium on February 16, 2009, 07:00:14 PM
Quote from: Tiribulus on February 16, 2009, 06:33:12 PM
Suse has always been good to me, but this is the meatiest setup I've ever attempted with it. It does seem that Debian and slackware are much more widely used for this stuff. Suse 11.1 does now have a LAMP option in it's install routine which I haven't tried. I have a bunch of ho hum computers like this one laying around. Maybe I'll give Debian a shot. I have Ubuntu on a laptop which it's fine for, but it seems a bit slim for server stuff. Then again it isn't the server version which probably explains that. Oh well, not to get too far off track.

There's nothing wrong with SuSE. The rule of thumb for servers is to use what you know.

Quote
In the meantime, I'll poke around here for some tips on configuring APC for SMF.

You can increase the cache size, but there's no point until you have more activity.

I appreciate your time and the other folks as well.

In the end Suse always plays ball, it just seems like most of the docs I find for anything above basic desktop stuff are for other distros leaving me in "interpret and stab around in the dim light" mode. I had to manually build a directory structure, deftly copying and pasting stuff around, to get the commands to run for APC for instance. But it worked and everything's running :o I was actually chuckling and surprised when it finally was.

Anyway, this leg of the journey is completed. I'll leave the APC config alone for now and relish the victory as, like you say, there's not enough action to even tell me how to proceed at this point.
Thanks again.

EDIT: This may be hard to believe, but even on this no traffic "toy" site with like 10 members the performance increase with APC is profound. Accessing it on other machines on my network from the outside loads every page in less than .2 seconds as opposed to like .5 or .6 before. The apc.php file is showing cache hits so it is definitely working 8)

Something like that

Quote from: Tiribulus on February 16, 2009, 08:32:29 PM
EDIT: This may be hard to believe, but even on this no traffic "toy" site with like 10 members the performance increase with APC is profound. Accessing it on other machines on my network from the outside loads every page in less than .2 seconds as opposed to like .5 or .6 before. The apc.php file is showing cache hits so it is definitely working 8)

It's not hard to believe at all. APC does two things:

  • It caches compiled PHP code. This saves about 300 ms every time the same page is loaded.
  • It stores user variables. This allows SMF to cache the results of some queries, dramatically reducing the number of queries needed for each page load.

I remember hearing something about APC planned to be included in PHP 6 by default.

青山 素子

Quote from: Tiribulus on February 16, 2009, 08:32:29 PM
I had to manually build a directory structure, deftly copying and pasting stuff around, to get the commands to run for APC for instance. But it worked and everything's running :o I was actually chuckling and surprised when it finally was.

Sorry I didn't get here sooner. A simple "pear install APC" should be all you need, assuming that PHP's pear script was installed (some distros put it in its own package). This also assumes you have the standard development tools and headers (including for PHP) installed.
Motoko-chan
Director, Simple Machines

Note: Unless otherwise stated, my posts are not representative of any official position or opinion of Simple Machines.


Tiribulus

#23
Quote from: Motoko-chan on February 16, 2009, 10:41:47 PM
Quote from: Tiribulus on February 16, 2009, 08:32:29 PM
I had to manually build a directory structure, deftly copying and pasting stuff around, to get the commands to run for APC for instance. But it worked and everything's running :o I was actually chuckling and surprised when it finally was.

Sorry I didn't get here sooner. A simple "pear install APC" should be all you need, assuming that PHP's pear script was installed (some distros put it in its own package). This also assumes you have the standard development tools and headers (including for PHP) installed.

Long story, short as possible:

A buddy of mine asked me in January if I would be interested in a possible business venture which would involve a forum site and since I was the only real "computer guy" in the group he asked me if I thought I could get something going within several months.

I'd never touched such a thing but told him I'd see what I could do. The big player being PHPBB I went over to arstechnica and asked those guys how hard it was. One the guys there with tons of forum experience recommended SMF which I'd never heard of.

I came here read the requirements and set about putting together a LAMP box that it would run on and decided to whip up a gardening forum my wife could fiddle around with. Forgetting the initial gymnastics I went through just getting SMF live and online it turns out I also had exactly none of the stuff you mention installed which are prerequisites for APC. Every install tut I found was for distros other than Suse so I wound up doing what I said which was piecing together a directory structure like the ones in the tutorials and running the pecl install learning one step at a time about all the stuff you mention (and more) as the terminal messages informed me what was missing. I didn't know ahead of time they would be needed.

This is just one thing. This whole process since the middle of last month has been, while frustrating at times, utterly fascinating. Truth be told I probably learned a lot more just because none of it has been that easy. I didn't go with a hosting service precisely because I wanted to learn how to do it all myself from the ground up.

Not so short, sorry about that, but there it is. I guess I said all that to say that assuming that I had anything ready to go would be a grand assumption indeed. Thanks for your guys time and patience. The fact I got it running pretty tight with no issues is very gratifying. I wish I would have started playing around with this kinda stuff years ago. I'd be good at it by now.

Something like that

Everyone starts somewhere. And knowing how things are put together is critical when you try to figure out why something isn't working. It's one of the best advantages open source systems have over Windows.

Tiribulus

#25
Vekseid mentioned fastcgi which I've spent quite a bit of time reading about now. That little voice is telling me that I could really throw a monkey wrench in my server if I don't set that up right. suse has packages for it, but I don't know. Seems a pretty major alteration.

Something like that

Quote from: Tiribulus on February 17, 2009, 11:17:00 PM
Vekseid mentioned fastcgi which I've spent quite a bit of time reading about now. That little voice is telling me that I could really throw a monkey wrench in my server if I don't set that up right. suse has packages for it, but I don't know. Seems a pretty major alteration.

There are two reasons for running PHP as FastCGI.

The first is that it removed PHP from each Apache thread. Right now, every thread has a few MB memory space for PHP. If you end up having a hundred Apache threads, that's a LOT of MB being used -- especially when most of those threads will just be serving images and the like.

The second is it allows you to control the number of PHP processes running at once. As each takes up a few MB of RAM, you can limit your RAM usage. You can also stop your server from being overwhelmed when things get busy -- extra requests queue up, and requests are still filled at top speed.

Tiribulus

#27
How hard is it to get set up and how bad can I cripple my server if I do it wrong is the source of my trepidation. Does it matter if I have apache2-mod_php5 already installed? Apparently it's supposed to work fine with APC... assuming both are setup correctly to work together. There's php5-fastcgi, apache2-mod_fcgid, FastCGI-devel and plain FastCGI. Am I going to need the dev pack regardless of which one I choose? On that note which one DO I choose?

Try finding answers to those questions online :(

What you posted is a capsulization of what I've seen and good reasons to learn it. I just don't want to wind up with a blank screen where my pages used to be :o

Vekseid

APC will work with fastcgi but it does not used shared memory, so you will need to disable any active acceleration - just the opcode cache. eAccelerator has not released a 5.2 compatible version, making the only 'reasonable' php accelerator xcache.

You will want apache2-mod_fcgid, for the module, as well as suexec, and possibly php5-fastcgi if fastcgi support was not directly compiled into your normal php-cgi binary.

I'm currently working on an article about how to set it up properly in Debian - gimme a week or so and it should go a long way to telling you how, even with Suse.
Adult Role Playing Forums - - Over five million posts - - Elliquiy's LAMP configuration (maybe NSFW)

Blog about Forums and Servers - - Twenty things to make Simple Machines Forum go faster

Private/Instant Message requests for free support will be ignored.

Tiribulus

QuoteForum:~ # suexec2 -V
-D AP_DOC_ROOT="/srv/www"
-D AP_GID_MIN=96
-D AP_HTTPD_USER="wwwrun"
-D AP_LOG_EXEC="/var/log/apache2/suexec.log"
-D AP_SAFE_PATH="/usr/local/bin:/usr/bin:/bin"
-D AP_UID_MIN=96
-D AP_USERDIR_SUFFIX="public_html"

It looks like suexec was included when I installed Apache. I only have APC running. I downloaded eaccellerator, but never installed it. Maybe I'll hang on and see what you put together. If my reading is accurate fastcgi radically changes the way the web server piece does business.

Vekseid

Err, yeah, forgot that caveat. Generally it's been recommended to have Apache rather than php handle the threading, however.

There is a slight flaw in that if you allow ssl you need to have a minimum of two processes running, however. This is less of an issue but people who decide to bounce between ssl and normal would notice, at least in Apache (don't know if nginx or lightty would let you bottle it to the same process...)
Adult Role Playing Forums - - Over five million posts - - Elliquiy's LAMP configuration (maybe NSFW)

Blog about Forums and Servers - - Twenty things to make Simple Machines Forum go faster

Private/Instant Message requests for free support will be ignored.

Something like that

#31
Quote from: Vekseid on February 18, 2009, 05:27:54 PM
There is a slight flaw in that if you allow ssl you need to have a minimum of two processes running, however. This is less of an issue but people who decide to bounce between ssl and normal would notice, at least in Apache (don't know if nginx or lightty would let you bottle it to the same process...)

I didn't know that about SSL in Apache. Good to know.

I'm not too familiar with lightty (other than it leaks RAM like a sieve), but Nginx doesn't even start PHP itself. It relies on you setting up a PHP FastCGI daemon that listens for requests. Then you configure Nginx to pass off all PHP requests to the PHP daemon. That PHP daemon can have APC running, which is what I do. It's a very stable configuration. My setup is currently handling over 27 million PHP hits per month. That's an average of 9 per second, but at peak times it's well over 30.

Tiribulus

I think my next major project is going to be getting a LAMP box built on Debian and Nginx. A thing I suspect will make this machine look like a walk in the park. I spent about an hour reading about Nginx yesterday. I like the minimalist mindset which is the way I've always run my Windows machines (as far as that's possible), but have never gotten good enough with Linux to go that way.

Something like that

Nginx is beautiful. It serves about 2.6 million requests a day for me, about 44GB/day, all in about 7 MB of RAM, and about 1% CPU. I love Nginx almost as much as freedom and liberty lol. I've actually found it easier to use than Apache, surprisingly enough.

PHP is still the big CPU eater, followed by MySQL. APC helps a lot.

Debian is nice to use on the command line. A new version was just released the other day. You can't go wrong with Debian for stability and reliability. You may also like Ubuntu, which is basically Debian made pretty. It's kept more up to date, but the underlying system is almost exactly the same. It's what I prefer to use, for servers and the desktop.

Tiribulus

When I get ready to do it I'll probably have some questions if that's OK. I like the little is a lot thing. My home gateway is a 13 year old Compaq deskpro P90 with 16 megs of ram, couple old intel nics, no hard drive, running Coyote Linux from a floppy disk for this same reason.

Something like that

Quote from: Tiribulus on February 18, 2009, 09:11:12 PM
When I get ready to do it I'll probably have some questions if that's OK. I like the little is a lot thing. My home gateway is a 13 year old Compaq deskpro P90 with 16 megs of ram, couple old intel nics, no hard drive, running Coyote Linux from a floppy disk for this same reason.

In the early 2000's, I was running Debian on a 486 as a gateway, with my own iptables scripts. It had 8 MB of RAM, two 130 MB harddrives (/var was on its own drive), and two ISA-bus NICs. I actually had Apache running on that sucker, but it would take about 5 seconds to respond to requests as it was swapped into RAM. lol. It also ran a mail daemon (either Qmail or Postfix, I forget), and Bind for DNS.

Your machine is a speed daemon! lol Just watch out for that F00F bug ;)

I'm now running a Linksys WRT54GS router with 32! MB of RAM, with a Tomato MLPPP firmware. It allows me to avoid the BitTorrent throttling Bell Canada has on their ADSL system, as the reseller I'm subscribed to, Teksavvy, supports Multi-link PPP on their infrastructure. It's got a 200 MHz BCM4712 MIPS CPU, overclocked to 216 MHz to improve stability (don't ask me why it does; I don't know). It's got 8 MB of flash, so there's lots of room to install stuff, too. Oh, and it does 215 BogoMips. My desktop does 3354. My server for my forums does 6138.

青山 素子

Quote from: Phalloidium on February 18, 2009, 06:46:41 PM
You can't go wrong with Debian for stability and reliability.

If you want stability and fairly updated stuff, look no further than Slackware. It's an awesome system and even more friendly to optimization than Debian.
Motoko-chan
Director, Simple Machines

Note: Unless otherwise stated, my posts are not representative of any official position or opinion of Simple Machines.


Something like that

Quote from: Motoko-chan on February 18, 2009, 09:47:07 PM
Quote from: Phalloidium on February 18, 2009, 06:46:41 PM
You can't go wrong with Debian for stability and reliability.

If you want stability and fairly updated stuff, look no further than Slackware. It's an awesome system and even more friendly to optimization than Debian.

It's been amazing Patrick has been able to keep up all those years. I'd miss my apt-get though ;)

青山 素子

Quote from: Phalloidium on February 18, 2009, 09:53:23 PM
It's been amazing Patrick has been able to keep up all those years. I'd miss my apt-get though ;)

Yes it is, and now we have Fred with Slamd64 (a multi-lib x86_64 port of Slackware). Also, there is slapt-get, although I use slackpkg for my needs.
Motoko-chan
Director, Simple Machines

Note: Unless otherwise stated, my posts are not representative of any official position or opinion of Simple Machines.


Something like that

Quote from: Motoko-chan on February 18, 2009, 09:56:31 PM
Quote from: Phalloidium on February 18, 2009, 09:53:23 PM
It's been amazing Patrick has been able to keep up all those years. I'd miss my apt-get though ;)

Yes it is, and now we have Fred with Slamd64 (a multi-lib x86_64 port of Slackware). Also, there is slapt-get, although I use slackpkg for my needs.

Well it's good to know you don't have to install everything off 40 floppies still ;)

Though who am I kidding... I first installed Linux off a CD only 10 years ago. I've never done a full floppy install, other than a mini-distro.

Advertisement: