Results 1 to 10 of 14

Thread: [COD2] Ping spikes when rounds start

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #11
    Assadministrator kung foo man's Avatar
    Join Date
    Jun 2012
    Location
    trailerpark
    Posts
    2,011
    Thanks
    2,102
    Thanked 1,084 Times in 753 Posts
    You might be able to gain some speed by removing code/scripts which are executed for every player on every other player, since this kind of code becomes exponentially expensive, like the player collision code.

    So you might try libcod and disableGlobalPlayerCollision() e.g. and optimize scripts doing that.

    To avoid these O(n^2) algorithms you could implement optimized versions, e.g. to find the nearest players of a player, you can use a kd tree search or just cache some values instead of recalculating it all the time.

    https://en.wikipedia.org/wiki/K-d_tr...ighbour_search

    I had the same problem of lag spikes, when I hosted NS zombies on a VPS, but I just decided to rent better suited hardware.

    What you can try quickly is to change the process priority (aka nice value) of this cod2 server, so it can suck up more time slices of 1 cpu: https://en.wikipedia.org/wiki/Nice_(Unix)

    In addition to that, pin the process on a specifc CPU and exclude all other processes from that core (with isolcpus), so 1 cpu is dedicated to this cod2 server only: http://xmodulo.com/run-program-proce...res-linux.html
    timescale 0.01

  2. The Following User Says Thank You to kung foo man For This Useful Post:

    Whiskas (5th February 2017)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •