Archived

This forum has been archived. Please start a new discussion on GitHub.

ThreadPool warning when Size=MaxSize

I initially configured a server with a ThreadPool Size=5 and a MaxSize=10. However, I observed that threads were being constructed and destroyed quite often (after 10 hours, I was up to 26,000 threads). In my case, each thread creation made a new DB Connection, so I was unhappy with this situation.

Instead, I configured Size=10 and did not set a MaxSize.

Now, I continue to observe these warnings:
ImagePosterCrawler-cl6: warning: thread pool `Ice.ThreadPool.Server' is running low on threads
Size=10, SizeMax=10, SizeWarn=8

Since the number of threads should now be fixed at 10 (min and max the same), why does Ice warn me about this?
>>> server describe ImagePosterCrawler-cl6
server `ImagePosterCrawler-cl6'
{
    application = `ImageServer'
    node = `cl6'
    exe = `java'
    pwd = `bin'
    activation = `on-demand'
    options = `-Djava.library.path=/usr/lib64/jmagick -Xmx100m -jar ImagePoster.jar PostContent@PostContentServerImageCrawlerGroup'
    properties
    {
        ImagePosterAdapter.Endpoints = `tcp -h cl6'
        Ice.MessageSizeMax = `10240'
        Ice.ThreadPool.Server.Size = `10'
        Ice.Default.Package = `com.wink.content'
    }
    adapter `ImagePosterAdapter'
    {
        id = `ImagePosterCrawler-cl6.ImagePosterAdapter'
        replica group id = `ImagePosterCrawlerGroup'
        endpoints = `tcp -h cl6'
        register process = `true'
        wait for activation = `true'
    }
}

Comments

  • By default, SizeWarn is 80% of SizeMax. Ice warns you so you get some indication that your server may be running out of threads and, if you were to add more threads, you could gain more concurrency.

    If you set SizeWarn == SizeMax, you will get a warning only when a request uses the last remaining thread in the pool; if you set SizeWarn == 0, you will not get any warnings.

    You may also want to read the FAQ about this topic.

    Cheers,

    Michi.