Usage of Netty WRITE_SPIN_COUNT -


i understand usage of netty's channel option "write_spin_count". effect of setting value higher or lower default( 16 ). should set @ all.? got netty documentation wasn't clear why , when should set value : http://netty.io/4.0/api/io/netty/channel/defaultchannelconfig.html#getwritespincount() per documentation says : returns maximum loop count write operation until writablebytechannel.write(bytebuffer) returns non-zero value. similar spin lock used in concurrency programming. improves memory utilization , write throughput depending on platform jvm runs on. default value 16.

the write spin count used control how many times underlying socket.write(...) called per netty write operation. keep in mind write netty's buffers underlying sockets may not transfer data in 1 try. there balance between how time of i/o thread can spent attempting write single buffer, , if buffer not written i/o thread must register write event , woken when underlying socket writable. later operation can expensive because usually socket writable , i/o thread woken attempts wait on select mechanism. describe can bee seen in niosocketchannel.

my advice these types of configuration options if observing performance issue benchmark use-case, or leave default value. benchmarks may reveal problem lies elsewhere, or @ least understand impacts of changing value specific use case.


Comments

Popular posts from this blog

python - Healpy: From Data to Healpix map -

c - Bitwise operation with (signed) enum value -

xslt - Unnest parent nodes by child node -