You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by "Charles A. Landemaine" <la...@gmail.com> on 2006/04/28 23:21:45 UTC

[users@httpd] Is there a "real" maximum number of connections?

I did some research and found out the # MaxClients variable defines
the maximum number of concurrent connections. I'd like to know if we
can define this variable to something like 2 millions.

I'm asking because I'm designing a chat application that people are
going to use through a web browser, and the connection to the server
will remain open for a minute, then the connection is closed and
reopen right away. The community is pretty large (several million
people).

Using open connections is probably the best way to handle the maximum
number of users per server, instead of querying each second for new
messages for instance. The only concern I have right now is how Apache
behaves with millions of concurrent open connections.
Thanks,

--
Charles A. Landemaine.


PS: Is there a way to search through
http://mail-archives.apache.org/mod_mbox/httpd-users/ ?

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Is there a "real" maximum number of connections?

Posted by Alexander Lazic <al...@none.at>.
Hi,

On Fre 28.04.2006 19:38, Charles A. Landemaine wrote:
>On 4/28/06, Kishore Jalleda <kj...@gmail.com> wrote:
>
>>I don't think that you can support a million connections on apache,
>>are you running this app on a mainframe, also check to see how much
>>Memory each child/worker thread would take up, as you would need (
>>1Million * (RAM/thread)) of Memory , so say if each connections takes
>>up 1Meg or even 500KB you would potentially need 1 Million Megs of
>>Memory ~= 1000GB ~= 1TB of Memory....
>
>Thank you Kishore. The application will be hosted on a load-balanced
>architecture. Also, the connections will be open, but most of the time,
>no data will be transfered because chats are idle, and basically, chat
>clients are waiting for new messages for minutes or hours sometimes.
>Kind regards,

As you write that you have a load-balanced architecture I think it would
be better to use more servers or more instances of Apache.

Then you can say to your load-balanced balance between
4/8/... servers|instances.

Have you develop for HTTP 1.0 or 1.1, what i mean is have you 1 Million
keep-alive connections or 7?

What is you backend, can the chat handle so many concurrent
connections/users?

regards

Alex

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Is there a "real" maximum number of connections?

Posted by "Charles A. Landemaine" <la...@gmail.com>.
On 4/28/06, Kishore Jalleda <kj...@gmail.com> wrote:
> I don't think that you can support a million connections on apache, are you
> running this app on a mainframe, also check to see how much Memory each
> child/worker thread would take up, as you would need ( 1Million *
> (RAM/thread)) of Memory , so say if each connections takes up 1Meg or even
> 500KB you would potentially need 1 Million Megs of Memory ~= 1000GB ~= 1TB
> of Memory....

Thank you Kishore. The application will be hosted on a load-balanced
architecture. Also, the connections will be open, but most of the
time, no data will be transfered because chats are idle, and
basically, chat clients are waiting for new messages for minutes or
hours sometimes.
Kind regards,

--
Charles A. Landemaine.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


[users@httpd] passing request to the server

Posted by Tiago Semprebom <ti...@yahoo.com.br>.
Hello,

I'm beginning the development of a handler module and one of the tasks 
of this module is change some request uri to another uri. I developed 
this small module (code below), in this small module I compare if an 
incoming request uri is equal a determinate uri if is true I change this 
request uri for an another uri. I need now to direct this request to the 
server for that it can serve this request and send the result to the 
client.

thank's in advanced,

Tiago Semprebom
---------------------------------------------------------------------------
#include "httpd.h"
#include "ap_config.h"
#include <stdio.h>

static int my_new_handler(request_rec *r)
{
    int APRStatus = OK;

    if (r->method_number != M_GET)
           return DECLINED;

    if (r->finfo.filetype == 0) {
    ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,"print_test: %s", 
r->uri);
    if (!strcmp(r->uri,"/tiago/precisas/index1.htm")){
        r->uri = "/tiago/imprecisas/index1.htm";
    }
        ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,"print_test2: %s", 
r->uri);
        return HTTP_NOT_FOUND;
    }

    return (APRStatus);
}
     
static void register_hooks(apr_pool_t *p)
{
 ap_hook_handler(my_new_handler,NULL,NULL,APR_HOOK_MIDDLE);
}

module AP_MODULE_DECLARE_DATA my_handler =
{
    STANDARD20_MODULE_STUFF,
    NULL,              /* create per-directory config structure */
    NULL,              /* merge per-directory config structures */
    NULL,              /* create per-server config structure */
    NULL,              /* merge per-server config structures */
    NULL,              /* command apr_table_t */
    register_hooks     /* register hooks */
};

		
---------------------------------
 Yahoo! Search
 Música para ver e ouvir: You're Beautiful, do James Blunt

Re: [users@httpd] Is there a "real" maximum number of connections?

Posted by Kishore Jalleda <kj...@gmail.com>.
On 4/28/06, Charles A. Landemaine <la...@gmail.com> wrote:
>
> I did some research and found out the # MaxClients variable defines
> the maximum number of concurrent connections. I'd like to know if we
> can define this variable to something like 2 millions.
>
> I'm asking because I'm designing a chat application that people are
> going to use through a web browser, and the connection to the server
> will remain open for a minute, then the connection is closed and
> reopen right away. The community is pretty large (several million
> people).
>
> Using open connections is probably the best way to handle the maximum
> number of users per server, instead of querying each second for new
> messages for instance. The only concern I have right now is how Apache
> behaves with millions of concurrent open connections.
> Thanks,
>
> --
> Charles A. Landemaine.
>
>
> PS: Is there a way to search through
> http://mail-archives.apache.org/mod_mbox/httpd-users/ ?
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>   "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
>

I don't think that you can support a million connections on apache, are you
running this app on a mainframe, also check to see how much Memory each
child/worker thread would take up, as you would need ( 1Million *
(RAM/thread)) of Memory , so say if each connections takes up 1Meg or even
500KB you would potentially need 1 Million Megs of Memory ~= 1000GB ~= 1TB
of Memory....Anyway coming to your question ....

Apache has some preset hard limits on the mac-clients setting defined in the
file
"/<SRC>/apache_1.3.33/src/include/httpd.h"

Here is the line that references the setting ....

/* Limit on the total --- clients will be locked out if more servers than
 * this are needed.  It is intended solely to keep the server from crashing
 * when things get out of hand.
 *
 * We keep a hard maximum number of servers, for two reasons --- first off,
 * in case something goes seriously wrong, we want to stop the fork bomb
 * short of actually crashing the machine we're running on by filling some
 * kernel table.  Secondly, it keeps the size of the scoreboard file small
 * enough that we can read the whole thing without worrying too much about
 * the overhead.
 */
#ifndef HARD_SERVER_LIMIT
#ifdef WIN32
#define HARD_SERVER_LIMIT 1024
#elif defined(NETWARE)
#define HARD_SERVER_LIMIT 2048
#else
#define HARD_SERVER_LIMIT 256
#endif
#endif
As you can see the Hard_Server_Limit is set to 256, so in this case the
Max_Clients setting can be atmost 256, so if you plan on increasing it
change the setting here in the file httpd.h on the line relating to your OS,
and recompile apache , and then change the Max-Clients Setting in httpd.conf
..

Kishore Jalleda