473,657 Members | 2,572 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2292
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*******@hotm ail.com> napisal w wiadomosci
news:e0******** *************** ***@posting.goo gle.com...
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_d efault.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
1516
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 7.2 using same MySQL version. Recently our master database server (2 AMD Cpu + 2Gb memory + 2Gb swap space) started to suffer from memory outages because of heavy load. During day available free memory is changing from 200Mb to 5Mb and when
0
1671
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 7.2 using same MySQL version. Recently our master database server (2 AMD Cpu + 2Gb memory + 2Gb swap space) started to suffer from memory outages because of heavy load. During day available free memory is changing from 200Mb to 5Mb and when...
79
14059
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 operating system would be appropriate. However, I do not know how to retrieve the information. Could you help? Klaus
1
1398
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 load (~25 req/sec) the application begins to return HTTP 404 errors for requests of a specific handler. The other handlers continue to work fine. This usually happens after about 30 minutes of sustained load. I don't think it is something in my...
19
5237
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 application under heavy load. When increasing the number of requests, all my memory is filled, and the Linux server begins to cache and remains frozen. ab -n 100 -c 10 http://localsite/testscript
6
1837
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 the udb jdbc driver): "values current timestamp" get that value and supply it "?" in the next insert statement :
20
1704
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 either a machine only or network range basis?? I have just found Shareguard that looks reasonably priced. My applications are for vertical market and are not likely to be cracked, BUT users are likely to pass working versions around if not...
2
1466
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 have a mobile web application which will download .cab file for pocket PC through InternetExplorer now i would like to know that is it possible for me to identify the device aganist which my application running? if so if it is nokia i will let the...
3
3142
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 - however the line of code where this occurs always seems to be where a cfmodule is called (not necessarily the same module as this changes all the time.) My question is: when calling cfmodule does it run under the current thread or is another thread...
0
8425
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8326
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8743
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
7355
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6177
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5647
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
2745
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1973
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1736
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.