Join the community today
Register Now

Wordpress wordpress site down some time.

Discussion in 'Blogs & CMS usage' started by karistuck, Aug 22, 2014.

  1. karistuck

    karistuck Member

    43
    2
    8
    Jun 1, 2014
    대한민국
    Ratings:
    +3
    Local Time:
    5:39 PM
    1.5.8
    My vps use 10~15 wordpress site on 2G Ram, 2 Core SSD 40G.

    But site down sometime.

    The site 20~30 visit per day that not enough 2G Ram and 2Core cpu?

    And I check /var/log/php-fpm/www-php-error.log
    Code:
    22-Aug-2014 05:06:20 UTC] PHP Warning:  require(): Unable to allocate memory for pool. in /home/nginx/domains/domain.com/public/wp-content/themes/nictitate/functions.php on line 53
    
    Code:
    [22-Aug-2014 15:43:38 Australia/Brisbane] PHP Notice:  Undefined property: JSite::$registeredurlparams in /home/nginx/domains/domain.com/public/libraries/joomla/cache/cache.php on line 639
    than change memory limit in php.ini

    Code:
    ; Maximum amount of memory a script may consume (128MB)
    ; http://php.net/memory-limit
    memory_limit = 1024M
    nginx.conf

    Code:
    user              nginx nginx;
    worker_processes 2;
    worker_priority -10;
    
    worker_rlimit_nofile 260000;
    timer_resolution 100ms;
    
    error_log         logs/error.log;
    
    pid               logs/nginx.pid;
    pcre_jit on;
    
    events {
        worker_connections  2048;
        accept_mutex on;
        accept_mutex_delay 100ms;
        use epoll;
        #multi_accept on;
    }
    
    http {
    include /usr/local/nginx/conf/pagespeedadmin.conf;
    include /usr/local/nginx/conf/fastcgi_param_https_map.conf;
    
    log_format      main    '$remote_addr - $remote_user [$time_local] $request '
                    '"$status" $body_bytes_sent "$http_referer" '
                    '"$http_user_agent" "$http_x_forwarded_for" "$gzip_ratio"'
                    ' "$connection" "$connection_requests" "$request_time"';
    
    access_log logs/access.log combined buffer=32k;
    
        index  index.php index.html index.htm;
        include       mime.types;
        default_type  application/octet-stream;
        charset utf-8;
    
            sendfile on;
            #sendfile_max_chunk 1m;
            tcp_nopush  on;
            tcp_nodelay off;
            server_tokens off;
            server_name_in_redirect off;
           
            keepalive_timeout  10;
            keepalive_requests 100;
            lingering_time 20s;
            lingering_timeout 5s;
            keepalive_disable msie6;
    
        gzip on;
        gzip_vary   on;
        gzip_disable "MSIE [1-6]\.";
            gzip_static on;
            gzip_min_length   1400;
            gzip_buffers      32 8k;
            gzip_http_version 1.0;
            gzip_comp_level 5;
            gzip_proxied    any;
            gzip_types text/plain text/css text/xml application/javascript application/x-javascript application/xml application/xml+rss application/ecmascript application/json image/svg+xml;
    
    client_body_buffer_size 256k;
    client_body_in_file_only off;
    client_body_timeout 60s;
    client_header_buffer_size 64k;
    ## how long a connection has to complete sending
    ## it's headers for request to be processed
    client_header_timeout  20s;
    client_max_body_size 10m;
    connection_pool_size  512;
    directio  4m;
    ignore_invalid_headers on;      
    large_client_header_buffers 8 64k;
    output_buffers   8 256k;
    postpone_output  1460;
    proxy_temp_path  /tmp/nginx_proxy/;
    request_pool_size  32k;
    reset_timedout_connection on;
    send_timeout     60s;
    types_hash_max_size 2048;
    server_names_hash_bucket_size 64;
    
    # for nginx proxy backends to prevent redirects to backend port
    # port_in_redirect off;
    
    open_file_cache max=10000 inactive=30s;
    open_file_cache_valid 120s;
    open_file_cache_min_uses 2;
    open_file_cache_errors off;
    open_log_file_cache max=4096 inactive=30s min_uses=2;
    
    ## limit number of concurrency connections per ip to 16
    ## add to your server {} section the next line
    ## limit_conn limit_per_ip 16;
    ## uncomment below line allows 500K sessions
    # limit_conn_log_level error;
    #######################################
    # use limit_zone for Nginx <v1.1.7 and lower
    # limit_zone $binary_remote_addr zone=limit_per_ip:16m;
    #######################################
    # use limit_conn_zone for Nginx >v1.1.8 and higher
    # limit_conn_zone $binary_remote_addr zone=limit_per_ip:16m;
    #######################################
    
    include /usr/local/nginx/conf/conf.d/*.conf;
    }
    
    I need your your some opinion.

    Thank you for watching
     

    Attached Files:

  2. eva2000

    eva2000 Administrator Staff Member

    30,168
    6,784
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,136
    Local Time:
    6:39 PM
    Nginx 1.13.x
    MariaDB 5.5
    unable to allocate memory for pool is same error you posted about at https://community.centminmod.com/threads/php-warning-require-unable-to-allocate-memory-for-pool.541. Your APC Cache needs more memory allocated to it and as per that thread I posted how to use APC Cache stats page to monitor your memory usage PHP-FPM - PHP Warning: require(): Unable to allocate memory for pool | Centmin Mod Community ;)

    Depending on what wordpress plugins you have installed, each wordpress site from my experience needs a minimum of 96-128MB of memory allocated for PHP Opcaching via APC Cache, Xcache or Zend Opcache. So for 15x Wordpress blogs at least 15x 96MB = 1,440MB :eek:
     
  3. karistuck

    karistuck Member

    43
    2
    8
    Jun 1, 2014
    대한민국
    Ratings:
    +3
    Local Time:
    5:39 PM
    1.5.8
    Im turn off apc and memcache.
    Will upgrade memory than use it again.

    Can I ask to one more?

    How much memory need for my 15 wordpress web site? Can you advice for me?

    Thank you @eva2000
     
  4. eva2000

    eva2000 Administrator Staff Member

    30,168
    6,784
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,136
    Local Time:
    6:39 PM
    Nginx 1.13.x
    MariaDB 5.5
    Hard to say as it all depends on what wordpress style and plugins you use.. probably 192MB per wordpress site would be minimum. So 4GB VPS bare minimum.
     
  5. karistuck

    karistuck Member

    43
    2
    8
    Jun 1, 2014
    대한민국
    Ratings:
    +3
    Local Time:
    5:39 PM
    1.5.8
    Every Site use WP-super-cache, akismet, xml-sitemap, jetpack, some security plugin. etc... 10~15 plugin use per site.

    Minium 4G.. lol

    Than setting apc shm.memory for 256M and php.ini memory_limit = 2000M for 4G vps?
     
  6. eva2000

    eva2000 Administrator Staff Member

    30,168
    6,784
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,136
    Local Time:
    6:39 PM
    Nginx 1.13.x
    MariaDB 5.5
    well optimisation advice is left to you the end user

    but APC memory = 2000M and php.ini memory_limit shouldn't need more than 256M to 512M.
     
    • Like Like x 1
  7. karistuck

    karistuck Member

    43
    2
    8
    Jun 1, 2014
    대한민국
    Ratings:
    +3
    Local Time:
    5:39 PM
    1.5.8
    lol, APC is high than php.ini
    Thank you @eva2000

    Really helpuful for me
     
  8. eva2000

    eva2000 Administrator Staff Member

    30,168
    6,784
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,136
    Local Time:
    6:39 PM
    Nginx 1.13.x
    MariaDB 5.5
  9. karistuck

    karistuck Member

    43
    2
    8
    Jun 1, 2014
    대한민국
    Ratings:
    +3
    Local Time:
    5:39 PM
    1.5.8
    yes, I was change setting up 1024M for APC and 256M in php.ini

    Than I fond some page System Cache Entries in myapc.php

    It's really interesting lol