# minimize ping?



## iMer (Apr 2, 2010)

hi
i'm the over of a freebsd 7.1 root in russia
i use it as a gameserver but the ping is too high so that some players get kick if they attack someone
the server has bandwith of 1 gbitps
has anyone a idea how i could minimiza the ping?
if gameserver is started it has a ping of ~ 130ms 
without it has only a ping of ~90 ms


----------



## richardpl (Apr 2, 2010)

You could enable polling(instead of using interrupts) and increase kern.hz


----------



## phoenix (Apr 3, 2010)

Which network adapters are you using?  If they are el cheapo RealTek, some variations of Broadcom onboard chipsets, onboad nVidia, most onboard Marvel chipsets, and similar, you should consider switching.  Intel, higher-end Broadcom, 3Com will get you much better performance.  Especially if you get ones that do a lot of the processing in hardware (checksums, TCP segment offload, etc).

How many, and how fast, of CPUs do you have?

How much RAM in the system?

Are you using FreeBSD 6, 7, 8?  If you are using 8, you can enable multiple network queues and spread the load across multiple CPUs.  You can also enable direct dispatch for the network.

Do some online searches for "net.isr.bindthreads", "net.isr.maxthreads", "net.isr.direct" for more information on that last one.


----------



## iMer (Apr 3, 2010)

phoenix said:
			
		

> Which network adapters are you using?  If they are el cheapo RealTek, some variations of Broadcom onboard chipsets, onboad nVidia, most onboard Marvel chipsets, and similar, you should consider switching.  Intel, higher-end Broadcom, 3Com will get you much better performance.  Especially if you get ones that do a lot of the processing in hardware (checksums, TCP segment offload, etc).
> Don't know maybe i should ask support
> How many, and how fast, of CPUs do you have?
> 2*Quad Core Xeon
> ...


thanks =)


----------



## phoenix (Apr 6, 2010)

Check the output of *ifconfig*.  That will list the driver used (em0 is using em driver, rl0 is using realtek, etc), as well as the features that are supported in hardware (RX_CSUM, TX_CSUM, TSO4, VLAN_HWTAG, etc).

You can't do multiple ISR threads bound to separate CPUs with FreeBSD 7.1, but you can enable net.isr.direct.  You should also check the output of *dmesg* (or read through /var/run/dmesg.boot) to see if the NICs list support for MSI/MSI-X (or read the man page to see if it's listed there).  If they do, then you can enable those features via *hw.pci.enable_msix* and *hw.pci.enable_msi*.  These are better/faster/more modern ways of handling hardware interrupts.


----------

