473,386 Members | 1,674 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Protection aganist heavy load on server

Hi Everyone,

Recently we have started to have performance problems on our server
which has the following configuration:

Win 2K
IIS 5
php

The traffic to our web site is on normal time 300 - 400 concurrent
users.
On a very busy day it can go up to 5000 concurrent users. In these
days we simply crash!

We have come up with a to do list which has two main items on it.
- Upgrade the server
- Create a gate-keeper system.

What I mean by that is, some other server or a front line application
will allow only say 2500 people into
the site and unless one session is expired it won't let in the new one
in.
Our site uses SSL. Because of this I can not use the IIS's
user limitation feature. Beacuse users on the site start with http,
you need your chance to
get into the site first. Then when you are logged in then again need
the
same chance, only this time for each request since AFAIK https doesn't
let
persistent connections.
I appreciate links to related resources and solutions and sorry for
bad English.

Buy the way, I did some tests to compare Windows and linux backend
and linux performed about %60 better. However, we have to
stick to windows since we use COM till I create a diffrent solution
to that. Do you think this is expected?

H.Ceylan
Jul 17 '05 #1
6 2279
Hi Hasan,
Win 2K
IIS 5
php How much RAM ? What Processor Speed ?

No Database ?

The traffic to our web site is on normal time 300 - 400 concurrent
users.
On a very busy day it can go up to 5000 concurrent users. In these
days we simply crash! How many Pageimpressions / Pagehits ?
We have come up with a to do list which has two main items on it.
- Upgrade the server
- Create a gate-keeper system.
[...]
Why do you use https ? and not http ?
Buy the way, I did some tests to compare Windows and linux backend
and linux performed about %60 better. Sounds like what i know for a long time ;-)
However, we have to stick to windows since
we use COM till I create a diffrent solution
to that.

Why do you use COM and for what? Can it be replaced ?

Is this a PHP Application which can be multiplied on
many servers ? (Load-Balancing ?)

Kind regards.
Karl Heinz
--
Dipl.Ing.(FH) Karl Heinz Marbaise | www.marbaise.org
Jabba Dabba Dooh ;-) | ICQ# 135949029

Jul 17 '05 #2
Hello,

On 03/25/2004 10:27 AM, Hasan Ceylan wrote:
Recently we have started to have performance problems on our server
which has the following configuration:

Win 2K
IIS 5
php


Multi-threaded servers like IIS or Apache 2 are not an ideal enviroment
for PHP with certain extensions that have non-reentrant code. You would
need to use PHP with Fast-CGI or drop the non-reentrant extensions if
you can.

Anyway, the reason most servers crash is due to the excess of
simultaneous database connections that are created by an equal number of
simultaneous Web server processes that are running.

One very efficient solution, in my experience must better than using any
connection pooling middleware, is to make static content like images be
served by a separate dedicated HTTP server like thttpd running probably
in a separate IP address or on the same IP address but on a different port.

This way, the main Web server will only run processes that serve PHP
scripts that use database connections. No process will be wasted on
non-database based content request. So, it will use much less processes
and simultaneous database connections during a peaks.

If you configure the Web server properly, it will kill excessive
processes after the peaks have happened and so any excessive database
persistent connections are so closed.

To implement this, you can use Apache 1.x but make sure KeepAlive is off.

--

Regards,
Manuel Lemos

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

PHP Reviews - Reviews of PHP books and other products
http://www.phpclasses.org/reviews/

Metastorage - Data object relational mapping layer generator
http://www.meta-language.net/metastorage.html
Jul 17 '05 #3
Uzytkownik "Hasan Ceylan" <ce*******@hotmail.com> napisal w wiadomosci
news:e0**************************@posting.google.c om...
Buy the way, I did some tests to compare Windows and linux backend
and linux performed about %60 better. However, we have to
stick to windows since we use COM till I create a diffrent solution
to that. Do you think this is expected?


Here lies the problem: COM support in PHP4 leaks memory like crazy. See
http://bugs.php.net/bug.php?id=21269

Try setting the application protectopn in IIS to highest. If that doesn't
work, run PHP as CGI.
Jul 17 '05 #4
Karl Heinz Marbaise <kh********@gmx.de> wrote in message news:<c3*************@ID-68093.news.uni-berlin.de>...

Hi Karl,
Hi Hasan,
Win 2K
IIS 5
php How much RAM ? What Processor Speed ?


I've got 1.256 GB RAM. Dual P III 1MHz
No Database ?

There is several different connections to MSSQL and MYSQL databases.
DB Servers are running on different boxes.

The traffic to our web site is on normal time 300 - 400 concurrent
users.
On a very busy day it can go up to 5000 concurrent users. In these
days we simply crash!

How many Pageimpressions / Pagehits ?


As it extra extra anourmously peaks on some times, normal hit rate
wouldn't
be a mesure. But in busy times it is over 200 hits/sec
We have come up with a to do list which has two main items on it.
- Upgrade the server
- Create a gate-keeper system.
[...]
Why do you use https ? and not http ?


Because Credit cards and password exchanged between browser and
server.
Buy the way, I did some tests to compare Windows and linux backend
and linux performed about %60 better. Sounds like what i know for a long time ;-)
> However, we have to stick to windows since
we use COM till I create a diffrent solution
to that.

Why do you use COM and for what? Can it be replaced ?


Yes. Our site previously ran on IIS and ASP. For purchase steps we
created some COM objects that create and maintain shoppingcarts and
talk to backend servers using client sockets. This has been in my task
list for a long time there is alot of rewriting needs to be done for
that.
Is this a PHP Application which can be multiplied on
many servers ? (Load-Balancing ?)

Kind regards.
Karl Heinz


Not without rewriting several parts of the application.

But also I do not want to server all the clients. I would like to
target
a number of sessions (like a thousand) and reject the rest till one
session
is expired and gracefully tell the others to wait. And the idea is
once
someone is in the site I should keep serving him.

I do not want to create a server farm for just a few days in a year.

Thanks for your response Karl,
Have nice day for everyone,
H.Ceylan
Jul 17 '05 #5
Hi Hasan,
I've got 1.256 GB RAM. Dual P III 1MHz I think you mean "1 GHz" instead of "1 MHz" ? ;-)

Ok. But it seemed to me that this is not enough for the
Hits / Seconds (200) you given ....
How many Pageimpressions / Pagehits ?

As it extra extra anourmously peaks on some times, normal hit rate
wouldn't
be a mesure. But in busy times it is over 200 hits/sec

That's very much....about 500 million per month....
Because Credit cards and password exchanged between browser and
server. Ok. I see you have to use https....
I do not want to create a server farm for just a few days in a year.

Ok.

I think this would be a classical way to use load balanced systems e.g.
minimum two servers ....and you will fit the needth....

But you've decided against ....and others have explained
other solutions....
Kind regards.
Karl Heinz
--
Dipl.Ing.(FH) Karl Heinz Marbaise | www.marbaise.org
Jabba Dabba Dooh ;-) | ICQ# 135949029

Jul 17 '05 #6
Hi Karl and All other fellows replied,

I did some tests and I have come to a solution and wanted to share and
have you guy's ideas on whether what I think is a resonable solution.

on my test box(linux, apache, php (I know I know ;) )), with MS Web
stress tool being the client
with a only one-print-statement-php I get 2000 req/sec.
<?
print "Hello World"';
?>

if I ran the code below, I get 1700 req/sec, which makes me think
this is not a heavy code.
<?
if (!($_REQUEST["PHPSESSID"])) {
$d = dir("/www/sess/");
$no=0;
while (false !== ($entry = $d->read() ))
$no++;
if (($no) > 500) {echo "too busy";exit;}
session_start();
}
?>
Then I include this into each page as the very first line.
To eliminate the overhead of parsing the whole page file before
execution, I iclude the main page's html-php scripts as well.

default.php:
<?
include("s.php");
include("main_default.php");
?>

Then I get 1600 req/sec.

This basically allows 500 people to go into the site while holding
others
with "too busy" error message.

The ideal number of sessions will be determined based on real world
testings I guess.

Regards,
Ceylan

Karl Heinz Marbaise <kh********@gmx.de> wrote in message news:<c4*************@ID-68093.news.uni-berlin.de>...
Hi Hasan,
I've got 1.256 GB RAM. Dual P III 1MHz

I think you mean "1 GHz" instead of "1 MHz" ? ;-)

Ok. But it seemed to me that this is not enough for the
Hits / Seconds (200) you given ....
How many Pageimpressions / Pagehits ?

As it extra extra anourmously peaks on some times, normal hit rate
wouldn't
be a mesure. But in busy times it is over 200 hits/sec

That's very much....about 500 million per month....
Because Credit cards and password exchanged between browser and
server.

Ok. I see you have to use https....
I do not want to create a server farm for just a few days in a year.

Ok.

I think this would be a classical way to use load balanced systems e.g.
minimum two servers ....and you will fit the needth....

But you've decided against ....and others have explained
other solutions....
Kind regards.
Karl Heinz

Jul 17 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Kayra Otaner | last post by:
Hi all, I want to get your opinions on how to increase available/free memory and performance on a heavy volume database server. I have MySQL 4.0.13 running on RH 7.2 replicated to another RH...
0
by: kayra | last post by:
Hi all, I want to get your opinions on how to increase available/free memory and performance on a heavy volume database server. I have MySQL 4.0.13 running on RH 7.2 replicated to another RH...
79
by: Klaus Bonadt | last post by:
In order to protect software from being copied without licence, I would like to use something like a key, which fits only to the current system. The serial number of the CPU or the current...
1
by: news.microsoft.com | last post by:
I have an ASP.NET application that uses both an HTTPModule and several HTTPHandlers. This application is running in a web farm environment on Windows 2003 Server using NLB. Under somewhat heavy...
19
by: Alex Madon | last post by:
Hello, I am testing a web application (using the DBX PHP function to call a Postgresql backend). I have 375Mb RAM on my test home box. I ran ab (apache benchmark) to test the behaviour of the...
6
by: Chris Burnley | last post by:
We're seeing very strange behaviour with db2 under heavy load. We're running our system in GMT and the timezone never changes for British Summer Time. Basically the thing we're doing is (using...
20
by: Paul Bromley | last post by:
Not sure if I can ask the question in this forum - please let me know if it is better elsewhere. Does anyone know of a reasonably priced good copy protection program that will protect software on...
2
by: vamsI007 | last post by:
Hi Knowledge Spices, I have a remote server which will have different versions (.cab,.sis) of the same application. I would like to download the supported extention file for the Device. I...
3
by: CF FAN | last post by:
We have been having issues with server performance and under heavy load JRun seems to hang. Dumps seem to suggest that the pages that are hanging are waiting for another thread to become available -...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.