WMS daily operation and maintenance _WJC

3.25, Oaks project the Apache server reached MaxClients setting problem

apachelog报错:[mpm_worker:error] [pid 2486:tid 140526322251584] AH00287: server is within MinSpareThreads of MaxRequestWorkers, consider raising the MaxRequestWorkers setting

Solution: Check for a moment, this is due to the number of concurrent links lead to too much!

solve:

 ps -ef | grep httpd | grep -v grep | wc -l - Check the amount of process

netstat -ant | grep -E ": 80 |: 443" | wc -l ---- View connections

netstat -ant | grep ESTABLISHED | grep -E ": 80 |: 443" --- view to establish connections

# We /usr/local/apache2/conf/extra/httpd-mpm.conf

<IfModule mpm_worker_module>

    StartServers 3

    MinSpareThreads         75

    MaxSpareThreads        250

    ThreadsPerChild         25

    ServerLimit            2000

    MaxRequestWorkers 1000

    MaxConnectionsPerChild   0

</IfModule>

3.26, Oaks project to thread limit a single IP connection, do not allow multi-threaded connection resources

For IP restrictions, adopted mod_limitipconn this module.

The advantage of this module is simple to configure, the disadvantage is not able to be set for individual folders or files, and does not support virtual hosts. 

After this module is installed in apache, add the following paragraphs in the configuration file can take effect: 

ExtendedStatus On 

< IfModule mod_limitipconn.c > 

    <Location /> # of all virtual hosts / directory 

        Each IP MaxConnPerIP 3 # 3 allows only concurrent connections 

        NoIPLimit image / * # of the picture do not do IP restrictions 

    < /Location > 

    <Location / mp3> # All host / mp3 directory 

        MaxConnPerIP 1 # IP allows only one connection per request    

        OnlyIPLimit audio / mpeg video # the restriction only to video and audio file formats 

    < /Location > 

< /IfModule >

3.27, Oaks Project No space left on device: Can not create SSLMutex

Error message "No space left on device: Can not create SSLMutex", the meaning of this sentence is no remaining resources to create shared variables SSLMutex

Linux can not think of the creation of the handle, and will not provide the service, then view the shared variable resource occupancy

ipcs : ipcs provides information on the ipc facilities for which the calling process has read access.

# ipcs -s 

------ Semaphore Arrays --------

key        semid      owner      perms      nsems    

0x00000000 0          root       600        1        

0x00000000 32769      root       600        1        

0x00000000 163842     apache     600        1        

0x00000000 196611     apache     600        1        

0x00000000 229380     apache     600        1        

0x00000000 262149     apache     600        1        

0x00000000 294918     apache     600        1 

There are hundreds of shared variables found to be occupied by the apache process can not be released, the depletion of resources.

So, you need to delete a shared variable signal reap resources, the delete command is as follows:

# ipcs -s | perl -ane '/^0x00000000/ && `ipcrm -s $F[1]`'

View ipcs limiting parameters: ipcs -l

# ipcs -l

------ Shared Memory Limits --------

max number of segments = 4096

max seg size (kbytes) = 67108864

max total shared memory (kbytes) = 17179869184

My themselves size (bytes) = 1

 

------ Semaphore Limits --------

max number of arrays = 128

max semaphores per array = 250

max semaphores system wide = 32000

max ops per semop call = 32

semaphore max value = 32767

 

------ Messages: Limits --------

max queues system wide = 3751

max size of message (bytes) = 65536

default max size of queue (bytes) = 65536

Find Me, Semaphore Limits up to 128, more than this number, httpd service will no longer start, and it leads the above sites not open.

3.28, Oaks project tomcat memory leak into dump file

Many tomcat process exit (or feign death process), are due to frequent thrown OutOfMemeoryError caused.

  To make tomcat time before exiting or OutOfMemeoryError happen automatically dump stack information for easy troubleshooting afterwards, we can do the following:

  1, was added in two parameters tomcat startup parameters -XX: + HeapDumpOnOutOfMemoryError -XX: HeapDumpPath = / export /oom.hprof

  2, restart tomcat

  Parameter Description

  (1) -XX: + HeapDumpOnOutOfMemoryError indicates when the JVM occurs OOM, DUMP automatically generated file.

  (2) -XX: HeapDumpPath = storage file / directory file represents a path generated DUMP

3.29, Oaks project tomcat three configurations of Session timeout

Setting Session Timeout way:

Way:
 disposed in web.xml session-config follows:
 <session-config>
  <-the session timeout> 2 </-the session timeout>
 </ session-config>
 
 i.e. the client and the server interaction twice the longest interval 2 minutes, 2 minutes session.getAttribute () Gets the value is null

Second way:
 in the Tomcat /conf/web.xml the session-config, the default value: 30 minutes
 <the session-config>
        <-the session timeout> 30 </-the session timeout>
    </ the session-config>
 
Three ways:
 in Servlet provided in
  the HttpSession Request.getSession the session = ();
  session.setMaxInactiveInterval (60); // seconds

Description:
 1. Priority: API provided in the Servlet> Settings program /web.xml> Tomcat / conf / web.xml set
 2. If the access server session timeout (the visit with the last access time interval is greater than the maximum session inactive interval), and that is the end of the last session, but the server and the client will generate a new session, before the session where property values are lost, resulting in new sesssionId
 3. the client and the server once a valid session (session no timeout), each accessing the same sessionId, if the code is set session.setMaxInactiveInterval () value, then the session maximum inactivity interval will be modified and applied to a new value.
 4.Session destruction (the end of the session on behalf of cycles): in a period called a request session.invalidate () method, the end of this period the request, session is destroyed; or automatically destroyed after the session timeout; client or off out browser

3.38, Changan project apache error ap_proxy_connect_backend disabling worker for (127.0.0.1)

The solution is to add "Retry = 0" parameter to the agent program instructions apache http server virtual host configuration, so it does not default to wait 60 seconds to try again.

ProxyPass / http://backendserver:8080/ retry=0

 

Guess you like

Origin www.cnblogs.com/Snowfun/p/11536577.html