Programming fun at startup: java Fair share Threadpool
To avoid thundering herd problem we only allow X no of write and Y no of reads to Msyql database from a node. Recently I introduced HA into our tomcat stack that reduced no of nodes by 60% and the HA is helpful but it can happen that one customer can hog all the threads in the cluster. Before HA this would cause a downtime of only one node but now it has a potential to bring down 1/4 th of data centre. To avoid this issue I was looking for various alternatives and finally the idea was to use a fair share thread pool that would pin an upper bound on no of threads per customer but it was becoming too complex and I was not going anywhere. I kept it as a background thread and then the worse happened and yesterday we had a downtime as one bad customer gobbled up all reader threads. So in crunch I came up with a java fair share threadpool approach by implementing a pool of thread pool.Read full article from Programming fun at startup: java Fair share Threadpool
No comments:
Post a Comment