Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

Server only allowing 7 scripts to run at once?

Discussion in 'Workarounds and Optimization' started by sleepin4ever, Sep 21, 2014.

  1. sleepin4ever

    sleepin4ever Registered

    Joined:
    Sep 6, 2014
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Website Owner
    I have been trying to run multiple scripts at once, but my server is only allowing 7. I am not sure what would be preventing more, so I'm starting here.

    Basically, I've got 10+ PHP scripts trying to run simultaneously. script1.php, script2.php, script3.php.. etc. They are all doing work on 2000 MySQL table entries, for example: "SELECT * FROM tableExample LIMIT 0, 2000", and each is making CURL requests to figure things out on each entry. I actually want to run a few hundred instances. I executed a dozen instances, and 7 start returning responses, while the others just hang. Nothing is actually processed from the ones that are hanging either; as soon as one of the 7 active ones finishes, a hanging one will begin to work and start output. Each script only consumes less than 1% of the servers resources. The whole server is using less than 15% resources at any time.

    I'm on a dedicated server with CentOS 7.5, 16GB mem, quad core, WHM/cpanel. My PHP memory limit is set to 4GB. I've included the my.cnf if it helps. My apache limits and clients are 256/150 (whm defaults), which is well beyond what I'm trying to do.

    I appreciate any suggestions or ideas! :D

    Code:
    [mysql]
    
    # CLIENT #
    port=3306
    socket="/var/lib/mysql/mysql.sock"
    
    [mysqld]
    slow-query-log=1
    long_query_time=1
    
    # GENERAL #
    user=mysql
    default-storage-engine=InnoDB
    socket="/var/lib/mysql/mysql.sock"
    pid-file="/var/lib/mysql/mysql.pid"
    
    # MyISAM #
    key-buffer-size=32M
    myisam-recover="FORCE,BACKUP"
    
    # SAFETY #
    max-allowed-packet=1G
    max-connect-errors=1000000
    
    # DATA STORAGE #
    datadir="/var/lib/mysql/"
    
    # BINARY LOGGING #
    log-bin="/var/lib/mysql/mysql-bin"
    expire-logs-days=14
    sync-binlog=1
    
    # CACHES AND LIMITS #
    tmp-table-size=32M
    max-heap-table-size=32M
    query-cache-type=0
    query-cache-size=0
    max-connections=5000
    thread-cache-size=50
    open-files-limit=65535
    table-definition-cache=1024
    table-open-cache=2048
    
    # INNODB #
    innodb-flush-method=O_DIRECT
    innodb-log-files-in-group=2
    innodb-flush-log-at-trx-commit=2
    innodb-file-per-table=1
    innodb-buffer-pool-size=6G
    
    # LOGGING #
    log-error="/var/lib/mysql/mysql-error.log"
    log-queries-not-using-indexes=1
    innodb_buffer_pool_size=134217728
    max_allowed_packet=268435456
    port=5123
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    43,711
    Likes Received:
    1,793
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello :)

    Do you notice any error messages in /usr/local/apache/logs/error_log when this happens? Have you installed any applications that kill processes based on usage?

    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice