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!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

WHM API1 createacct slowness

Discussion in 'cPanel Developers' started by Aaron Todd, Nov 2, 2016.

Tags:
  1. Aaron Todd

    Aaron Todd Member

    Joined:
    Mar 13, 2015
    Messages:
    5
    Likes Received:
    2
    Trophy Points:
    3
    Location:
    mICHIGAN
    cPanel Access Level:
    DataCenter Provider
    Hello,

    I have a server running 58.0.32. I have been using the WHM API1 createacct function to automate account creation, and the past few days its been causing a bit of trouble. I am connecting to the API using PHP via the XML-API class (GitHub - CpanelInc/xmlapi-php: A PHP Class for Interacting with cPanel's XML-API). Here is an example snippet:

    Code:
    include_once '../include/xmlapi.php';
    
    $xmlapi = new xmlapi($host);
    $xmlapi->set_port(2087);
    $xmlapi->password_auth($my_user, $my_pass);
    $xmlapi->set_output('array');
    $xmlapi->set_debug(0);
    
    $newAccount = array(username => "example",
                        password => "pass",
                        domain => "example.example.com",
                        pkgname => "Default",
                        contactemail => "example@example.com");
    
    $account_status = $xmlapi->createacct($newAccount);
    The code does eventually complete, but it seems to be taking an extremely long time to respond. It didn't seem to always act this way.

    Can anyone confirm this? Does anyone know if something recently changed in the API that would cause it to take a bit longer to complete?

    Thanks in advance...
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    38,658
    Likes Received:
    1,425
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello @Aaron Todd,

    I've not seen additional reports of this problem, but if you'd like, you can open a support ticket using the link in my signature so we can take a closer look.

    That said, have you had a chance to test this on a server running cPanel version 60? Improved account creation speed is one of the most popular enhancements we've added:

    Version 60 is planned for publication to the "Release" build tier this week.

    Thank you.
     
  3. Aaron Todd

    Aaron Todd Member

    Joined:
    Mar 13, 2015
    Messages:
    5
    Likes Received:
    2
    Trophy Points:
    3
    Location:
    mICHIGAN
    cPanel Access Level:
    DataCenter Provider
    @cPanelMichael,

    Thank you for your response.

    After additional troublshooting I have found that every time I run my PHP script these errors pop in the CPANEL event_log file:

    The only other big change that has been made recently is that my host changed the Apache MPM from EVENT to WORKER. I am going to have them revert this tonight and see what happens.

    Also, no I haven't tried v60 yet. If my plan for tonight doesnt render good results I'll attempt to update and see what happens and/or open an official ticket.

    Thanks again for getting back with me!
     
    cPanelMichael likes this.
  4. Aaron Todd

    Aaron Todd Member

    Joined:
    Mar 13, 2015
    Messages:
    5
    Likes Received:
    2
    Trophy Points:
    3
    Location:
    mICHIGAN
    cPanel Access Level:
    DataCenter Provider
    @cPanelMichael,

    Just for the sake of someone elses sanity, I wanted to report that the Apache WORKER MPM seemed to be the cause of my problems. I'm not sure if its the multi-threaded aspect that doesn't play nice with PHP and/or the CPANEL daemon, but reverting back seemed to make things happy again.
     
Loading...

Share This Page