1. The forums will be archived and moved to a read only mode in about 2 weeks (mid march).

Lot of tick entity cpu usage

Discussion in 'General discussion' started by dadodasyra, Nov 12, 2020.

  1. dadodasyra

    dadodasyra Witch

    Messages:
    68
    GitHub:
    dadodasyra
    Is that normal (title) ? and how to reduce this problem
    https://timings.pmmp.io/?id=92649

    For the packets (sending & receive), I think it must be a plugin that does shit (unless you tell me otherwise) except that I have no idea how to find it other than by rereading the entire code.
     
  2. GamakCZ

    GamakCZ Zombie Pigman

    Messages:
    598
    GitHub:
    GamakCZ
    From the timings you sent I consider for plugins slowing the server:
    - Homes by kielking
    - essentialsTP by poggit-orphanage
    - Stats
    - EconomyAPI by poggit-orphanage

    As two plugins of it are from poggit orphanage (they are strict for making plugins optimized), the problem isn't in plugins, but in the server. I'd recommend you to change your hosting provider, or hosting plan. You need better CPU (or maybe more RAM, if you haven't enough)

    Also I don't think pocketmine is build for hosting 100 players on one server as it is running only on one thread. You should split the server on to more, smaller servers.
     
  3. dadodasyra

    dadodasyra Witch

    Messages:
    68
    GitHub:
    dadodasyra
    Yes it is expected because I have the impression that no matter the performance Pocketmine saturates towards 90 players. For the home plugin, I reviewed it and it doesn't seem too heavy to me, the problem probably comes from auto save (and from the fact that it is save in JSON). The stats plugin was developed by me quite a while ago and actually I do about 2 requests on each event you see (quit and join) to Mysql, which can slow down the main thread, what do you recommend? An async task or a thread? I never succeeded in using the thread properly and I have the impression that the performance used by the thread is still on the timings (strange).
    For essentials tp I am far from your opinion, having opened it I noticed an astronomical amount of sqlite requests for very little interest (doing a 1 second cooldown on a command, I totally re-adapted it and in the future will no longer exist).

    Finally this does not answer the packet problem, here I have the impression that what eats the most CPU is the Player Network Send and Player Network Receive. According to the timings again, only 1% of the processor would be used by plugins (Plugin Scheduler), but I believe very little.

    For my components I don't think it's possible to find better at a reasonable price. I am on a dedicated machine, 8 physical cores of I9 9900K (I know that pocketmine does not use more than one since it is very little multithreaded), 64 gb of DDR4 for the ram and 1 tera of nvme. So I think it's not this the problem.
     
  4. GamakCZ

    GamakCZ Zombie Pigman

    Messages:
    598
    GitHub:
    GamakCZ
    Okay, it isn't possible to find better CPU at the time. However in your case is 8 16-thread intel useless as pocketmine can use only one thread from it. Other threads will be unused... As I said, try split the server on to small servers using some proxy (Nemisys, Waterdog, ...)
     
  5. GamakCZ

    GamakCZ Zombie Pigman

    Messages:
    598
    GitHub:
    GamakCZ
    About mysql queries, you should completely execute them in async task. Here is an example how I am executing them.
     
  6. dadodasyra

    dadodasyra Witch

    Messages:
    68
    GitHub:
    dadodasyra
    Yes yes as I told you it is planned to separate the server (with a proxy developed by a friend), otherwise I would never have taken a machine with so many cores.
     
  7. dadodasyra

    dadodasyra Witch

    Messages:
    68
    GitHub:
    dadodasyra
    I noticed not too long ago that admittedly the async task is on a separate thread but is queuing, so there is not one thread per task, but each task is executed on a belonging thread a pmmp, set in pocketmine.yml. If I put 6 threads in config for the async task and I send 7 async task the 7th task must wait until one of the 6 has finished to be executed. Also, a lot of poggit plugins use mysql and don't go async, sad, (economy api, piggy factions)
     
  8. GamakCZ

    GamakCZ Zombie Pigman

    Messages:
    598
    GitHub:
    GamakCZ
    https://github.com/pmmp/PocketMine-MP/blob/stable/src/pocketmine/resources/pocketmine.yml#L20
    PocketMine creates how many threads you want, then split the async task on to it's workers. I don't even notice the mysql query are queried in async task... as you have intel i9 with 16 threads, I don't think the tasks will have to wait for other to finish. I have only 6 threads (4.4GHz) and it perfectly handled up to 200 players.
     
  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.