• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Lack of interest Graceful load handling

Cezz

Well-known member
#8
And not Windows. :/ Nevermind - I still support the suggestion.
equivalent for windows
Code:
<?php
ob_start();
passthru('typeperf -sc 1 "\processor(_total)\% processor time"',$status);
$content = ob_get_contents();
ob_end_clean();
if ($status === 0) {
    if (preg_match("/\,\"([0-9]+\.[0-9]+)\"/",$content,$load)) {
        if ($load[1] > get_config('busy_error')) {
            header('HTTP/1.1 503 Too busy, try again later');
            die('Server too busy. Please try again later.');
        }
    }
}
?>
 

Shamil

Well-known member
#10
Code:
equivalent for windows
[COLOR=#0000bb]<?php
ob_start[/COLOR][COLOR=#007700]();
[/COLOR][COLOR=#0000bb]passthru[/COLOR][COLOR=#007700]([/COLOR][COLOR=#dd0000]'typeperf -sc 1 "\processor(_total)\% processor time"'[/COLOR][COLOR=#007700],[/COLOR][COLOR=#0000bb]$status[/COLOR][COLOR=#007700]);
[/COLOR][COLOR=#0000bb]$content [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000bb]ob_get_contents[/COLOR][COLOR=#007700]();
[/COLOR][COLOR=#0000bb]ob_end_clean[/COLOR][COLOR=#007700]();
if ([/COLOR][COLOR=#0000bb]$status [/COLOR][COLOR=#007700]=== [/COLOR][COLOR=#0000bb]0[/COLOR][COLOR=#007700]) {
    if ([/COLOR][COLOR=#0000bb]preg_match[/COLOR][COLOR=#007700]([/COLOR][COLOR=#dd0000]"/\,\"([0-9]+\.[0-9]+)\"/"[/COLOR][COLOR=#007700],[/COLOR][COLOR=#0000bb]$content[/COLOR][COLOR=#007700],[/COLOR][COLOR=#0000bb]$load[/COLOR][COLOR=#007700])) {
        if ([/COLOR][COLOR=#0000bb]$load[/COLOR][COLOR=#007700][[/COLOR][COLOR=#0000bb]1[/COLOR][COLOR=#007700]] > [/COLOR][COLOR=#0000bb]get_config[/COLOR][COLOR=#007700]([/COLOR][COLOR=#dd0000]'busy_error'[/COLOR][COLOR=#007700])) {
            [/COLOR][COLOR=#0000bb]header[/COLOR][COLOR=#007700]([/COLOR][COLOR=#dd0000]'HTTP/1.1 503 Too busy, try again later'[/COLOR][COLOR=#007700]);
            die([/COLOR][COLOR=#dd0000]'Server too busy. Please try again later.'[/COLOR][COLOR=#007700]);
        }
    }
}
[/COLOR][COLOR=#0000bb]?>[/COLOR]
Holy crap :eek:
 

Jerry

Well-known member
#16
But it is a "serious" server? Well, at least Microsoft is trying to make is serious in PHP/MySQL hosting.

I am currently preferring the performance on Windows than Linux.
There is no competition between them, a well set up Linux machine will wipe the floor with windows.
 

Dean

Well-known member
#17
There is no competition between them, a well set up Linux machine will wipe the floor with windows.
You seem to know much about these things, are there any advantages to a windows server?

I am not that technical, but it seems Linux works really well, at least for us.
 

Jerry

Well-known member
#19
You seem to know much about these things, are there any advantages to a windows server?

I am not that technical, but it seems Linux works really well, at least for us.
I worked for a Tier 1 host for years with many thousands of machines (as well as vB for a while) and found that typically it familiarity for developers who work on windows locally who haven't worked in unix enough to feel OK with it.

Though for people who's education/career/hobbies took them though C/scripting/*nix/etc ....... they don't look back.

Think this thread is a little off topic...
I dare say the first post is all that is needed for a suggestion I think.
 

Tigratrus

Well-known member
#20
You seem to know much about these things, are there any advantages to a windows server?

I am not that technical, but it seems Linux works really well, at least for us.
Only thing I like about windows server is the RDC (remote desktop connection) that allows you to remote in and use a full desktop GIU just like you were sitting at the server. You can do something like that with VNC for 'nix boxes, but it's got some major security issues.

For the non-cli savvy (I'm working on it, but still fall into this group), this can be a very helpful interface. Using a Windows based VPS this way can also be hugely helpful as it gives you a remote admin box with super highspeed network connections for doing VERY large file transfers, backups etc. It's also helpful as you can load up things like Navicat etc on the remote box and then connect to it from anywhere using a thin client and initiating all processes on the remote box.

As an actually production webserver though?
:: slow headshake ::
Not even on a bet... :rolleyes: