Maximum number of concurrent connections exceeded in Apache HTTP

1

I'm using Apache HTTP Server 1.3.29

Currently, I have an Apache server that is experiencing the error:

  Internal Server Error 500 Exception: EWebBrokerException Message: Maximum number of concurrent connections exceeded. Please try again later

This message appears when many users are using the system, but do not know the number of connections to cause this.

I need help to optimize the server to support more connections / access

Here are the important parts of httpd.conf of the server:

ServerType standalone

PidFile logs/httpd.pid

ScoreBoardFile logs/apache_runtime_status

Timeout 5

KeepAlive On

MaxKeepAliveRequests 0

KeepAliveTimeout 1

MaxRequestsPerChild 0

ThreadsPerChild 500


ClearModuleList

AddModule mod_so.c
AddModule mod_setenvif.c

Port 80

DocumentRoot "C:/Arquivos de programas/Apache Group/Apache/htdocs"

<Directory />
    Options FollowSymLinks
    AllowOverride None
</Directory>

<Directory "C:/Arquivos de programas/Apache Group/Apache/htdocs">


Options Indexes FollowSymLinks MultiViews

    AllowOverride None

    Order allow,deny
    Allow from all
</Directory>


<IfModule mod_userdir.c>
    UserDir "C:/Arquivos de programas/Apache Group/Apache/users/"
</IfModule>


<IfModule mod_dir.c>
    DirectoryIndex index.html
</IfModule>


AccessFileName .htaccess

<Files ~ "^.ht">
    Order allow,deny
    Deny from all
    Satisfy All
</Files>

UseCanonicalName On


<IfModule mod_mime.c>
    TypesConfig conf/mime.types
</IfModule>

DefaultType text/plain

<IfModule mod_mime_magic.c>
    MIMEMagicFile conf/magic
</IfModule>


HostnameLookups Off

ErrorLog logs/error.log

LogLevel warn

ServerSignature On


<IfModule mod_autoindex.c>

      IndexOptions FancyIndexing

        AddIconByEncoding (CMP,/icons/compressed.gif) x-compress x-gzip

    AddIconByType (TXT,/icons/text.gif) text/*
    AddIconByType (IMG,/icons/image2.gif) image/*
    AddIconByType (SND,/icons/sound2.gif) audio/*
    AddIconByType (VID,/icons/movie.gif) video/*

    AddIcon /icons/binary.gif .bin .exe
    AddIcon /icons/binhex.gif .hqx
    AddIcon /icons/tar.gif .tar
    AddIcon /icons/world2.gif .wrl .wrl.gz .vrml .vrm .iv
    AddIcon /icons/compressed.gif .Z .z .tgz .gz .zip
    AddIcon /icons/a.gif .ps .ai .eps
    AddIcon /icons/layout.gif .html .shtml .htm .pdf
    AddIcon /icons/text.gif .txt
    AddIcon /icons/c.gif .c
    AddIcon /icons/p.gif .pl .py
    AddIcon /icons/f.gif .for
    AddIcon /icons/dvi.gif .dvi
    AddIcon /icons/uuencoded.gif .uu
    AddIcon /icons/script.gif .conf .sh .shar .csh .ksh .tcl
    AddIcon /icons/tex.gif .tex
    AddIcon /icons/bomb.gif core

    AddIcon /icons/back.gif ..
    AddIcon /icons/hand.right.gif README
    AddIcon /icons/folder.gif ^^DIRECTORY^^
    AddIcon /icons/blank.gif ^^BLANKICON^^

    DefaultIcon /icons/unknown.gif


    ReadmeName README
    HeaderName HEADER

        IndexIgnore .??* *~ *# HEADER* README* RCS CVS *,v *,t

</IfModule>

<IfModule mod_mime.c>

    AddType application/x-tar .tgz

    AddEncoding x-compress .Z
    AddEncoding x-gzip .gz .tgz

    <IfModule mod_negotiation.c>
        LanguagePriority en da nl et fr de el it ja kr no pl pt pt-br ru ltz ca es sv tw
    </IfModule>

</IfModule>

Not for lack of machine features. The server has 16GB of RAM and a great processor, when the problem occurs the consumption is not even 30%, maybe some adjustment in Apache.

    
asked by anonymous 23.07.2015 / 15:08

2 answers

1

By default, the maximum number of connections is 256, as per documentation . / p>

To increase, you can try to include (or change) in your httpd.conf something like this:

<IfModule mpm_worker_module>
    MaxClients          1000
    MinSpareThreads      25
    MaxSpareThreads      75 
    ThreadsPerChild      25
</IfModule>

Here you can see an extensive description of how to optimize settings for competing connections and / or maximum number of clients.

    
23.07.2015 / 15:21
0

What operating system are you using?

To view the active connections on your server, type this command at the prompt:

netstat -an | grep :8025 | grep -i EST | wc -l

* where 8025 is the port of your apache;

Okay, now you get an idea of the active connections on your server.

Enter this optimization for 1000 clients in your httpd.conf:

<IfModule mpm_worker_module>
  ServerLimit 40
  StartServers 2
  MaxClients 1000
  MinSpareThreads 25
  MaxSpareThreads 75 
ThreadsPerChild 25
MaxRequestsPerChild 0
</ IfModule>

Here a link explaining this error.

    
23.07.2015 / 16:22