 |
|
 |
|
Next: Arghhh....Wibble..
|
| Author |
Message |
External

Since: Sep 14, 2004 Posts: 2384
|
(Msg. 16) Posted: Fri Aug 06, 2004 1:42 am
Post subject: Re: Any Linux server experts about? [Login to view extended thread Info.] Archived from groups: alt>www>webmaster (more info?)
|
|
|
William Tasso wrote:
> Matt Probert wrote:
>> On Thu, 05 Aug 2004 17:07:11 +0100 Toby Inkster
>> <usenet200408.DeleteThis@tobyinkster.co.uk> broke off from drinking a cup of tea
>> at to write:
>>> ...
>>> Otherwise, try putting a check in at the beginning of your search
>>> script to check CPU load. If CPU load is high then switch to a less
>>> CPU-intensive algorithm.
>>>
>>
>> The principle sounds good, basically test cpuload (can I do that with
>> an environment variable? A rhetorical question, I'll try and see what
>> happens) and behave accordingly. Not a solution, but may help the
>> system from jamming up while a permanent solution is arranged.
>
> Alternatively you could build in a delay when the server is busy.
> Spamcop uses a client side implementation - I expect there are
> server-side solutions that don't add much to cpu load.
That could be interesting. "You are currently 47th in line to search"!
Just avin a larf.
--
Charles Sweeney
<a style='text-decoration: underline;' href="http://CharlesSweeney.com" target="_blank">http://CharlesSweeney.com</a><!-- ~MESSAGE_AFTER~ --> >> Stay informed about: Any Linux server experts about? |
|
| Back to top |
|
 |  |
External

Since: Sep 14, 2004 Posts: 2384
|
(Msg. 17) Posted: Fri Aug 06, 2004 1:42 am
Post subject: Re: Any Linux server experts about? [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
|
|
|
Toby Inkster wrote:
> Matt Probert wrote:
>
>> The principle sounds good, basically test cpuload (can I do that with
>> an environment variable?
>
> Certainly not an environment variable
Toby, what did the man say? Rhetorical question!
--
Charles Sweeney
<a style='text-decoration: underline;' href="http://CharlesSweeney.com" target="_blank">http://CharlesSweeney.com</a><!-- ~MESSAGE_AFTER~ --> >> Stay informed about: Any Linux server experts about? |
|
| Back to top |
|
 |  |
External

Since: Jul 07, 2004 Posts: 20
|
(Msg. 18) Posted: Fri Aug 06, 2004 1:42 am
Post subject: Re: Any Linux server experts about? [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
|
|
|
Toby Inkster <usenet200408.TakeThisOut@tobyinkster.co.uk> emerged reluctantly
from the curtain and staggered drunkenly up to the mic. In a
cracked and slurred voice he muttered:
> Matt Probert wrote:
>
>> The principle sounds good, basically test cpuload (can I do
>> that with an environment variable?
>
> Certainly not an environment variable on a Unix box. It ought to
> be possible to write a 10 line C program to get the CPU load
> (using the getloadavg system call), then you can grab the load
> from your PHP/Perl/ whatever script using:
>
> $cpuload = `/path/to/cpuloadprogram`;
>
> Also another idea: "man nice".
>
Or just (PHP):
if ( file_exists('/proc/loadavg') ) {
if ( $fh = @fopen( '/proc/loadavg', 'r' ) ) {
$data = @fread( $fh, 6 );
@fclose( $fh );
$load_avg = explode( " ", $data );
$server_load = trim($load_avg[0]);
if ($server_load > $load_limit) {
# Please Wait
}
}
}
This only works on Linux though, BSD based systems don't keep a
"loadavg" file.
--
Phil Roberts | Deedle Doot Doo Dee Dee | <a style='text-decoration: underline;' href="http://www.flatnet.net/" target="_blank">http://www.flatnet.net/</a>
I could be wrong here, You could be right
Please forgive me I have sinned - Not on your life
But that's how you want me, But I'll never fear thee
Why you and not me? Tell me Holy Man<!-- ~MESSAGE_AFTER~ --> >> Stay informed about: Any Linux server experts about? |
|
| Back to top |
|
 |  |
External

Since: May 08, 2004 Posts: 953
|
(Msg. 19) Posted: Fri Aug 06, 2004 1:42 am
Post subject: Re: Any Linux server experts about? [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
|
|
|
On 5 Aug 2004 19:42:29 GMT, Charles Sweeney <me.TakeThisOut@charlessweeney.com> wrote:
>> Alternatively you could build in a delay when the server is busy.
>> Spamcop uses a client side implementation - I expect there are
>> server-side solutions that don't add much to cpu load.
>
> That could be interesting. "You are currently 47th in line to search"!
>
> Just avin a larf.
Honestly, if you're at the point where you're considering the
implementation of delays in scripts... Give yourself a decent slap, put up
some AdSense ads, buy more servers and start load-balancing.
The easiest way is the best way! Not necessarily the cheapest way, but
try putting a ¤cyunit; value to the daily stress of wondering how
many customers are getting pissed off with your slow server speed...
Grey
--
The technical axiom that nothing is impossible sinisterly implies the
pitfall corollory that nothing is ridiculous.
- <a style='text-decoration: underline;' href="http://www.greywyvern.com" target="_blank">http://www.greywyvern.com</a> - Orca Knowledgebase: Completely CSS styleable
Knowledgebase/FAQ system<!-- ~MESSAGE_AFTER~ --> >> Stay informed about: Any Linux server experts about? |
|
| Back to top |
|
 |  |
External

Since: Apr 29, 2004 Posts: 1010
|
(Msg. 20) Posted: Fri Aug 06, 2004 9:20 am
Post subject: Re: Any Linux server experts about? [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
|
|
|
"Matt Probert" <comments.RemoveThis@probertencyclopaedia.com> wrote in message
news:41122698.19761335@news.ntlworld.com...
> On 5 Aug 2004 10:49:37 GMT Charles Sweeney <me.RemoveThis@charlessweeney.com>
> broke off from drinking a cup of tea at No thank you to write:
>
> >Matt Probert wrote:
> >
> >> Any Linux server experts about?
> >>
> >> We have a problem with our server being a little overloaded, I
> >> eventually managed to get the following out of "top":
> >>
> >> 5:17am up 118 days, 15:02, 1 user, load average: 141.56, 144.92,
> >> 144.34
> >
> >As you may know those numbers are VERY high!
> >
>
> VERY being an understatement! Couldn't even telnet in - okay I
> eventually got in and got the top line of top!
>
> >Looks like you may have a runaway process.
>
> You might have thought so, so we did a reboot. That turfed some of the
> concurrent connections off <g> sorry lads! Anyway, it was just over
> use. Too damned popular! Either that or someone was running multiple
> searches in a loop as a DoS, it will be a while before I can check
> logs to ascertain this, but it seems unlikely.
>
What is your setup? there are ways of limiting access to control the cpu
usage<!-- ~MESSAGE_AFTER~ --> >> Stay informed about: Any Linux server experts about? |
|
| Back to top |
|
 |  |
External

Since: Sep 14, 2004 Posts: 1625
|
(Msg. 21) Posted: Fri Aug 06, 2004 11:01 am
Post subject: Re: Any Linux server experts about? [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
|
|
|
On Fri, 6 Aug 2004 06:20:04 +1200 "Bill Logan" <who.DeleteThis@what.com> broke
off from drinking a cup of tea at CLEAR Net New Zealand
<a style='text-decoration: underline;' href="http://www.clear.net.nz" target="_blank">http://www.clear.net.nz</a> - Complaints abuse.DeleteThis@clear.net.nz to write:
>What is your setup? there are ways of limiting access to control the cpu
>usage
>
Standard Raq 4
Matt<!-- ~MESSAGE_AFTER~ --> >> Stay informed about: Any Linux server experts about? |
|
| Back to top |
|
 |  |
External

Since: Sep 14, 2004 Posts: 1625
|
(Msg. 22) Posted: Fri Aug 06, 2004 11:25 am
Post subject: Re: Any Linux server experts about? [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
|
|
|
On Thu, 05 Aug 2004 22:02:44 +0100 Toby Inkster
<usenet200408.TakeThisOut@tobyinkster.co.uk> broke off from drinking a cup of tea
at to write:
>Toby Inkster wrote:
>
>> else {
>> $query = 'SELECT term,entry FROM encycopaedia '.
>> "WHERE term='$search'";
>> }
>
>Even better -- if CPU load is high -- forward the query on to Google
>
Go and wash your mouth out with soap!
Matt
--
If your encyclopaedia doesn't list "widget glass", you're reading the wrong encyclopaedia.
The Probert Encyclopaedia. Its not the same.
<a style='text-decoration: underline;' href="http://www.probertencyclopaedia.com" target="_blank">http://www.probertencyclopaedia.com</a><!-- ~MESSAGE_AFTER~ --> >> Stay informed about: Any Linux server experts about? |
|
| Back to top |
|
 |  |
External

Since: Sep 14, 2004 Posts: 1625
|
(Msg. 23) Posted: Fri Aug 06, 2004 11:27 am
Post subject: Re: Any Linux server experts about? [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
|
|
|
On Thu, 05 Aug 2004 22:13:39 GMT Baho Utot
<baho-utot.TakeThisOut@philippines-island.org> broke off from drinking a cup of
tea at Road Runner High Speed Online <a style='text-decoration: underline;' href="http://www.rr.com" target="_blank">http://www.rr.com</a> to write:
>Matt Probert wrote:
>
>You can do load balancing (crudely but it works) with nothing more than the
>3 machines and a properly setup DNS. Setup the DNS with the A records
>having the same domain but the three differrent IP's. I have the doc's
>someplace, I think you may be able to fetch the DNS Docs/HOWTOS from
>http://www.tldp.org/docs.html. The DNS will then dish out connections,
>first one to server 1, second one to server 2 and third one to server 3,
>then repeats.
This sounds like a brilliantly simple idea. Have 3 computers on
different IP addresses, but all with identical web sites, and three
DNS records for one domain name, each pointing at one of the three IP
addresses?
I'll investigate further....
Matt<!-- ~MESSAGE_AFTER~ --> >> Stay informed about: Any Linux server experts about? |
|
| Back to top |
|
 |  |
External

Since: Sep 19, 2003 Posts: 3499
|
(Msg. 24) Posted: Fri Aug 06, 2004 12:07 pm
Post subject: Re: Any Linux server experts about? [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
|
|
|
Matt Probert wrote:
> On Thu, 05 Aug 2004 22:13:39 GMT Baho Utot
> <baho-utot.RemoveThis@philippines-island.org> broke off from drinking a cup of
> tea at Road Runner High Speed Online <a style='text-decoration: underline;' href="http://www.rr.com" target="_blank">http://www.rr.com</a> to write:
>> ...
>> The DNS will
>> then dish out connections, first one to server 1, second one to
>> server 2 and third one to server 3, then repeats.
>
> This sounds like a brilliantly simple idea. Have 3 computers on
> different IP addresses, but all with identical web sites, and three
> DNS records for one domain name, each pointing at one of the three IP
> addresses?
>
> I'll investigate further....
<a style='text-decoration: underline;' href="http://www.google.com/search?q=round+robin+dns" target="_blank">http://www.google.com/search?q=round+robin+dns</a>
--
William Tasso
Recommended reading ...
<a style='text-decoration: underline;' href="http://www.catb.org/~esr/faqs/smart-questions.html" target="_blank">http://www.catb.org/~esr/faqs/smart-questions.html</a>
<a style='text-decoration: underline;' href="http://www.aww-faq.org/" target="_blank">http://www.aww-faq.org/</a><!-- ~MESSAGE_AFTER~ --> >> Stay informed about: Any Linux server experts about? |
|
| Back to top |
|
 |  |
External

Since: Sep 14, 2004 Posts: 2384
|
(Msg. 25) Posted: Fri Aug 06, 2004 12:22 pm
Post subject: Re: Any Linux server experts about? [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
|
|
|
Matt Probert wrote:
> On Thu, 05 Aug 2004 22:13:39 GMT Baho Utot
> <baho-utot DeleteThis @philippines-island.org> broke off from drinking a cup of
> tea at Road Runner High Speed Online <a style='text-decoration: underline;' href="http://www.rr.com" target="_blank">http://www.rr.com</a> to write:
>
>>Matt Probert wrote:
>>
>>You can do load balancing (crudely but it works) with nothing more
>>than the 3 machines and a properly setup DNS. Setup the DNS with the
>>A records having the same domain but the three differrent IP's. I
>>have the doc's someplace, I think you may be able to fetch the DNS
>>Docs/HOWTOS from <a style='text-decoration: underline;' href="http://www.tldp.org/docs.html." target="_blank">http://www.tldp.org/docs.html.</a> The DNS will then
>>dish out connections, first one to server 1, second one to server 2
>>and third one to server 3, then repeats.
>
> This sounds like a brilliantly simple idea. Have 3 computers on
> different IP addresses, but all with identical web sites, and three
> DNS records for one domain name, each pointing at one of the three IP
> addresses?
>
> I'll investigate further....
Certainly looks like a short to mid-term solution. The simplicity of it
being a big plus. You could even get your second server on a different
data centre for semi-redundancy.
From what I have read, it looks like you have to use WWW (or other host
name) in your urls, or forward to WWW urls, which may or may not be a
concern for you.
--
Charles Sweeney
<a style='text-decoration: underline;' href="http://CharlesSweeney.com" target="_blank">http://CharlesSweeney.com</a><!-- ~MESSAGE_AFTER~ --> >> Stay informed about: Any Linux server experts about? |
|
| Back to top |
|
 |  |
External

Since: Aug 02, 2004 Posts: 145
|
(Msg. 26) Posted: Fri Aug 06, 2004 9:43 pm
Post subject: Re: Any Linux server experts about? [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
|
|
|
Charles Sweeney wrote:
> From what I have read, it looks like you have to use WWW (or other host
> name) in your urls,
Nonsense. Even if that were true, you could use CNAMEs to get around the
restriction without having to resort to HTTP redirects.
$ORIGIN example.com
$TTL 86400
@ IN CNAME foobar
foobar IN A 10.0.0.1
IN A 10.0.0.2
IN A 10.0.0.3
--
Toby A Inkster BSc (Hons) ARCS
Contact Me ~ <a style='text-decoration: underline;' href="http://tobyinkster.co.uk/contact" target="_blank">http://tobyinkster.co.uk/contact</a><!-- ~MESSAGE_AFTER~ --> >> Stay informed about: Any Linux server experts about? |
|
| Back to top |
|
 |  |
External

Since: Oct 23, 2003 Posts: 137
|
(Msg. 27) Posted: Fri Aug 06, 2004 10:36 pm
Post subject: Re: Any Linux server experts about? [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
|
|
|
Charles Sweeney wrote:
> Matt Probert wrote:
>
>> On Thu, 05 Aug 2004 22:13:39 GMT Baho Utot
>> <baho-utot.RemoveThis@philippines-island.org> broke off from drinking a cup of
>> tea at Road Runner High Speed Online <a style='text-decoration: underline;' href="http://www.rr.com" target="_blank">http://www.rr.com</a> to write:
>>
>>>Matt Probert wrote:
>>>
>>>You can do load balancing (crudely but it works) with nothing more
>>>than the 3 machines and a properly setup DNS. Setup the DNS with the
>>>A records having the same domain but the three differrent IP's. I
>>>have the doc's someplace, I think you may be able to fetch the DNS
>>>Docs/HOWTOS from <a style='text-decoration: underline;' href="http://www.tldp.org/docs.html." target="_blank">http://www.tldp.org/docs.html.</a> The DNS will then
>>>dish out connections, first one to server 1, second one to server 2
>>>and third one to server 3, then repeats.
>>
>> This sounds like a brilliantly simple idea. Have 3 computers on
>> different IP addresses, but all with identical web sites, and three
>> DNS records for one domain name, each pointing at one of the three IP
>> addresses?
>>
>> I'll investigate further....
>
> Certainly looks like a short to mid-term solution. The simplicity of it
> being a big plus. You could even get your second server on a different
> data centre for semi-redundancy.
>
Charles,
Am I vindicated now?
--
There are 10 types of people in this world
Those that understand binary and those that don't<!-- ~MESSAGE_AFTER~ --> >> Stay informed about: Any Linux server experts about? |
|
| Back to top |
|
 |  |
External

Since: Apr 29, 2004 Posts: 1010
|
(Msg. 28) Posted: Fri Aug 06, 2004 11:20 pm
Post subject: Re: Any Linux server experts about? [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
|
|
|
"Matt Probert" <comments.TakeThisOut@probertencyclopaedia.com> wrote in message
news:41132cbd.869169@news.ntlworld.com...
> On Fri, 6 Aug 2004 06:20:04 +1200 "Bill Logan" <who.TakeThisOut@what.com> broke
> off from drinking a cup of tea at CLEAR Net New Zealand
> <a style='text-decoration: underline;' href="http://www.clear.net.nz" target="_blank">http://www.clear.net.nz</a> - Complaints abuse.TakeThisOut@clear.net.nz to write:
>
> >What is your setup? there are ways of limiting access to control the cpu
> >usage
> >
>
> Standard Raq 4
>
Ok, as others have said, you can get a bigger server, or more working
together, OR you can sharpen the tools you have to do a better, more
efficient job. The first two will cost you bucks. The third is mostely
headaches, time and a little effort.
If you prefer the latter get out the disprin and head of to
<a style='text-decoration: underline;' href="http://forums.ev1servers.net/showthread.php?s=f1e422441ee37fffcc819ae6e7ea7" target="_blank">http://forums.ev1servers.net/showthread.php?s=f1e422441ee37fffcc819ae6e7ea7</a>
bbc&threadid=35305&highlight=reduce+server+load
for a beginners guide to optimising a server to reduce/manage load<!-- ~MESSAGE_AFTER~ --> >> Stay informed about: Any Linux server experts about? |
|
| Back to top |
|
 |  |
|
You can post new topics in this forum You can reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|
|
 |
|
|