The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Magento php cgi cpu usage up to 96%

Discussion in 'Workarounds and Optimization' started by jaheem, May 31, 2017.

  1. jaheem

    jaheem Registered

    Joined:
    May 31, 2017
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Morocco
    cPanel Access Level:
    Root Administrator
    Hello All
    i'm using magento and cpu usage is up to 96% in php-cgi
    wanna fix this mysql
    im using mariadb
    [!!] Query cache may be disabled by default due to mutex contention.
    [!!] Joins performed without indexes: 4301
    [!!] Key buffer used: 32.3% (5M used / 16M cache)
    [!!] Write Key buffer hit rate: 11.5% (1M cached / 136K writes)

    Thank you
    Code:
    my mysql config
    [mysqld]
    log-error=/var/lib/mysql/m4883.contaboserver.net.err
    performance-schema=0
    
    ### MyISAM #
    key_buffer_size = 16M # keep it low if no myisam data
    myisam-recover-options = FORCE,BACKUP
    
    ### SAFETY #
    innodb = force
    max_allowed_packet=268435456
    max_connect_errors = 100000
    bind-address = 127.0.0.1
    skip-name-resolve
    #skip-innodb
    
    ### LANGUAGE #
    #init_connect='SET collation_connection = utf8_unicode_ci'
    #init_connect='SET NAMES utf8'
    #character-set-server=utf8
    #collation-server=utf8_unicode_ci
    #skip-character-set-client-handshake
    
    ### CACHES AND LIMITS #
    back_log = 20
    interactive_timeout = 7200
    wait_timeout = 7200
    net_read_timeout = 120
    net_write_timeout = 300
    sort_buffer_size = 2M
    read_buffer_size = 2M
    read_rnd_buffer_size = 2M
    join_buffer_size = 2M
    tmp_table_size = 128M
    max_heap_table_size = 128M
    query_cache_type = 1
    query_cache_size = 64G
    max_connections = 550
    thread_cache_size = 32
    thread_pool_size = 16
    open_files_limit = 65535
    table_definition_cache = 4000
    table_open_cache = 4000
    
    ### INNODB_ #
    innodb_thread_concurrency = 0
    innodb_lock_wait_timeout = 7200
    innodb_flush_method = O_DIRECT
    innodb_flush_log_at_trx_commit = 2
    innodb_log_files_in_group = 2
    innodb_log_file_size = 3G
    innodb_log_buffer_size = 32M
    innodb_file_per_table = 1
    innodb_read_io_threads = 8
    innodb_write_io_threads = 8
    innodb_buffer_pool_instances = 20
    innodb_buffer_pool_size = 20G
    
    i hav 256g memory and 10core cpu
     
    #1 jaheem, May 31, 2017
    Last edited by a moderator: May 31, 2017
  2. Anoop P Alias

    Anoop P Alias Well-Known Member

    Joined:
    Mar 31, 2015
    Messages:
    65
    Likes Received:
    6
    Trophy Points:
    8
    Location:
    Kochi,Kerala,India
    cPanel Access Level:
    Root Administrator
    you should use a better PHP server API like PHP-FPM. CGI is slow and does need to load a slow interpreter in every request.
    Additionally, if you use PHP-FPM you would be able to use opcode caches like opcache to speed up PHP execution. This is not possible in CGI .

    Magento is well supported by nginx ,so you can use a cPanel nginx plugin to additionally boost static file serving speeds.
     
  3. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    37,064
    Likes Received:
    1,287
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello,

    As far as reviewing the existing MySQL resource usage, you may also find a command such as "mysqladmin processlist" helpful to see which MySQL processes are running.

    Thank you.
     
  4. jaheem

    jaheem Registered

    Joined:
    May 31, 2017
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Morocco
    cPanel Access Level:
    Root Administrator
    Please can you help me i hav big problem when i active php-frp

    Code:
    You don't have permission to access /customer/account/login/referer for login
    
    and other page giv
    
    [SIZE=6][B]Internal Server Error[/B][/SIZE]
    The server encountered an internal error or misconfiguration and was unable to complete your request.
    
    Please contact the server administrator at - Removed - to inform them of the time this error occurred, and the actions you performed just before this error.
    
    More information about this error may be available in the server error log.
    
    Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request.
    
    could any one help Please

    Thank you
     
    #4 jaheem, May 31, 2017
    Last edited by a moderator: Jun 1, 2017
  5. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    37,064
    Likes Received:
    1,287
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Could you let us know what is output to /usr/local/apache/logs/error_log when this happens?

    Thank you.
     
  6. jaheem

    jaheem Registered

    Joined:
    May 31, 2017
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Morocco
    cPanel Access Level:
    Root Administrator
    I FIX the problem but still have one problem when i activate php-fpm rewrite not work all page say File not found.

    Code:
    [Fri Jun 02 05:10:12.626519 2017] [auth_digest:notice] [pid 3403] AH01757: generating secret for digest authentication ...
    [Fri Jun 02 05:10:12.630954 2017] [mpm_prefork:notice] [pid 3403] AH00163: Apache/2.4.25 (cPanel) OpenSSL/1.0.1e-fips mod_bwlimited/1.4 configured -- resuming normal operations
    [Fri Jun 02 05:10:12.630963 2017] [core:notice] [pid 3403] AH00094: Command line: '/usr/sbin/httpd'
    [Fri Jun 02 05:10:18.352417 2017] [proxy_fcgi:error] [pid 5975] [client 196.217.xx.xxx:56036] AH01071: Got error 'Primary script unknown\n', referer: - removed -
    [Fri Jun 02 05:10:20.856327 2017] [proxy_fcgi:error] [pid 5975] [client 196.217.xx.xxx:56036] AH01071: Got error 'Primary script unknown\n', referer: - Removed -
    
    but is working with php-cgi but cpu usage is 96% and site slow
     
    #6 jaheem, Jun 1, 2017
    Last edited by a moderator: Jun 2, 2017
  7. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    37,064
    Likes Received:
    1,287
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
  8. jaheem

    jaheem Registered

    Joined:
    May 31, 2017
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Morocco
    cPanel Access Level:
    Root Administrator
    Thank you for your help
     
Loading...

Share This Page