WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] WordPress Optimization or Server configuration (3 posts)

  1. theblindmonk
    Member
    Posted 1 year ago #

    Hi all,

    I have a highly customized wordpress theme running 2 amazon aws ec2 micro servers using a load balancer. I notice after i browse the site around for about 5 - 10 minutes(or say around 50 clicks) the memory of the servers reach full(~600mb) on each server.
    apache 2 threads take up about 10mb each. This happens everytime i restart the server(which starts with around 450mb free and quickly fills up). Once it reaches it's peak, any new requests are handled really slow.

    I have turned off swapping but have enabled memcache and apc opcode. I'm also using w3ctotal cache.

    I'm not sure where the problem lies:
    - Is it possible that there is a memory leak?
    On my localhost testing, i never run out of memory or server never crashes.
    - Is it likely some server setting in apache is wrong on mine?
    - Combination of above two?

    I'm not sure why the memory never falls down at all, shouldn't the thread handling a request release memory after the timeout period?

    I know this is a lot of questions, but i'm really looking for any help on how to optimize the site better.

    Thanks for any help!

  2. Pioneer Valley Web Design
    Member
    Posted 1 year ago #

    On my localhost testing, i never run out of memory or server never crashes.

    U think this indicates that it is not a WordPress issue...since it appears not to be, you should consult server forums as applicable...

  3. theblindmonk
    Member
    Posted 1 year ago #

    Thanks Seacoast! Yes it does appear to be my server settings and not specific to wordpress. After searching and tweaking around a bit, i think i have found a much better server configuration which releases memory once the client is not active on the website or closes the tab.

    For anyone interested, my server settings under /etc/apache2/apache2.conf is as below. Essentially reduced the amount of keepalive time.

    #
    # Timeout: The number of seconds before receives and sends time out.
    #
    Timeout 40
    
    #
    # KeepAlive: Whether or not to allow persistent connections (more than
    # one request per connection). Set to "Off" to deactivate.
    #
    KeepAlive On
    
    #
    # MaxKeepAliveRequests: The maximum number of requests to allow
    # during a persistent connection. Set to 0 to allow an unlimited amount.
    # We recommend you leave this number high, for maximum performance.
    #
    MaxKeepAliveRequests 50
    
    #
    # KeepAliveTimeout: Number of seconds to wait for the next request from the
    # same client on the same connection.
    #
    KeepAliveTimeout 2
    
    ##
    ## Server-Pool Size Regulation (MPM specific)
    ## 
    
    # prefork MPM
    # StartServers: number of server processes to start
    # MinSpareServers: minimum number of server processes which are kept spare
    # MaxSpareServers: maximum number of server processes which are kept spare
    # MaxClients: maximum number of server processes allowed to start
    # MaxRequestsPerChild: maximum number of requests a server process serves
    <IfModule mpm_prefork_module>
        StartServers          5
        MinSpareServers       3
        MaxSpareServers      5
        MaxClients           13
        MaxRequestsPerChild  1000
    </IfModule>

Topic Closed

This topic has been closed to new replies.

About this Topic