Forum Moderators: bakedjake

Message Too Old, No Replies

How have you setup your Linux webserver

NICE values

         

trillianjedi

11:23 am on Jul 15, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I've spent the morning playing with NICE (priority) settings on one of our servers.

It's quite interesting - occasionally we get hit with a large unexpected volume of traffic - we have one application (not web related) which always needs to keep running, so I set it's NICE value to -1 and have apache set at 5.

Most of the lower priority processes I've now set at between 5 and 10.

It has made a noticeable difference.... which I didn't expect. The website actually appears faster - I guess that's from lowering the priority of the low-importance processes.

Any have some insights and experience with ideal settings for webservers?

TJ

wheel

12:05 am on Jul 19, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



This may be obvious, but the command
ps aux
will give you all the running processes. You should know what every single one of them is, and turn off any that are not needed. When I don't know what a process is, I make a point of finding out. I've gotten rid of a ton of garbage by doing that. And I feel a bunch better about security.

Keep things in different partitions - so one full section of the hard drive doesn't take the server offline. I don't put the logs in the same partition as anything else. Actually, I put the logs on a seperate drive.

Non-essential services I only run when needed. For example webmin. I log in to the server and start the webmin daemon when I want to use it, then shut it down when I'm done.

Outside of specific software tweaks, those things I find have helped me trim what's happening on the server substantially. Though your nice idea is great, I'll have to look at it shortly. Is there a way to force a program to a specific nice level evertime it's started (I know how to change the priority of a running process, but can it be automated?)

trillianjedi

4:06 pm on Jul 20, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi Wheel,

Glad there's someone else around interested in chatting about these issues. Thanks for the tip about removing stuff you don't know about. There's a few processes I have running and haven't got a clue what they're doing. I'll do some digging and find out if I can safely remove them.

Is there a way to force a program to a specific nice level evertime it's started (I know how to change the priority of a running process, but can it be automated?)

Just prefix at the command line, eg:-

NICE -n 5 httpd

To run httpd with a reduced priority of 5.

TJ

SeanW

8:05 pm on Jul 21, 2005 (gmt 0)

10+ Year Member



_Appears_ faster, or _is_ faster? :)

Most of my tuning has been on the application level (ie SQL queries) or playing with httpd settings. Getting rid of .htaccess checking by defaults (allowoverides none), allowing symlink following, and turning off DNS checks are sure ways to increase speed.

Sean

wheel

2:37 pm on Jul 22, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Good points Sean! Can you elaborate on turning off dns checks?

SeanW

3:25 pm on Jul 22, 2005 (gmt 0)

10+ Year Member



By default apache uses IP addresses for everything (logging, ACL checking) There is a setting that forces httpd to do a reverse resolve for incoming connection which sucks for performance.

Also any allow from/deny from rules should make use of numbers, not names. It's been a while, but I think that with resolution turned off names in ACLs won't work anyway.

Sean

trillianjedi

3:41 pm on Jul 23, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Good tips on DNS Sean - thanks.

_Appears_ faster, or _is_ faster?

Appears faster.

I don't actually care whether it is faster or not - I'm concentrating on user perception.

TJ

mack

3:52 pm on Jul 23, 2005 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



Tuning at application level can be very importaint. For example if you run very large or demanding mysql databases then you will almost definatly want to make changes in your my.conf

Mack.