Archived

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

<adapter>.ThreadPool.Size

Hi

I'm fresh to Ice. I'm working on tuxedo now, and I'm trying to do some test for Ice to make sure that if ice could do the same job as tuxedo. I find Ice works great. But now I have some little problem about the adapter's thread pool size.

How to set the thread pool size for specific adapter? I tried as the doc said, add <adapter>.ThreadPool.Size property for the adapter, but nothing happens. The server.exe 's process still have the same thread count as before.(I'm using windows and use MSVC's process viewer tool to watch the thread)

I'm using the cut $ice-2.1.0/demo/icepack/simple,get rid of the ssl and icebox issue. The property Ice.ThreadPool.Server.Size works(it generates 4 more threads),but Server.Hello.ThreadPool.Size doesn't.

I hope some one could help me,thanks.

this is part of my application.xml

inside the icepack/application/node tags

<server name="Server" kind="cpp" exe="./server" activation="on-demand">
<adapters>
<adapter name="Hello" endpoints="default" register="true">
<object identity="hello1" type="::Demo::Hello"/>
</adapter>
</adapters>

<properties>
<property name="Identity" value="hello1"/>
<property name="Ice.ThreadPool.Server.Size" value="5"/>
<property name="Server.Hello.ThreadPool.Size" value="3"/>
</properties>
</server>

Comments

  • matthew
    matthew NL, Canada
    suroot wrote:
    Hi
    ...
    <server name="Server" kind="cpp" exe="./server" activation="on-demand">
    <adapters>
    <adapter name="Hello" endpoints="default" register="true">
    <object identity="hello1" type="::Demo::Hello"/>
    </adapter>
    </adapters>

    <properties>
    <property name="Identity" value="hello1"/>
    <property name="Ice.ThreadPool.Server.Size" value="5"/>
    <property name="Server.Hello.ThreadPool.Size" value="3"/>
    </properties>
    </server>

    The name of the object adapter is "Hello", not "Server.Hello". Therefore, you should use

    <property name="Hello.ThreadPool.Size" value="3"/>

    Best Regards, Matthew
  • I both tried Server.Hello or Hello as the adapter's name, they're not working.

    Thanks
  • matthew
    matthew NL, Canada
    suroot wrote:
    I both tried Server.Hello or Hello as the adapter's name, they're not working.

    Thanks

    I testing by setting the thread pool size to 20 for the Hello adapter and it worked as expected.

    What is your IcePack configuration file? There are two servers in the default simple configuration file, and the client will randomly pick one on startup, so if you don't set the property in the correct location then the server will not have the expected number of threads.

    Regards, Matthew
  • I remove the icebox server.
    here is my config file

    Thanks
  • matthew
    matthew NL, Canada
    suroot wrote:
    I remove the icebox server.
    here is my config file

    Thanks

    I took your configuration file and tested it with the simple demo. For kicks I changed the number of threads for the Hello adapter to 120. The server process (server.exe) has 124 threads as I would expect.

    Are you redeploying with the changed application descriptor? The easiest way to do this for a demo is to kill the icepacknode and remove db/node/* and db/registry/* and then restart the node and redeploy with icepackadmin.

    If you look at db/node/servers/Server/config you can see the config file that the server is actually run with by IcePack. Mine looks something like this:

    # Server configuration
    Ice.ProgramName=Server
    Hello.ThreadPool.Size=120
    Identity=hello1
    Ice.ThreadPool.Server.Size=5
    Ice.ThreadPool.Server.SizeWarn=6

    # Adapter Hello
    Hello.Endpoints=default
    Hello.AdapterId=Server.Hello
    Hello.RegisterProcess=1

    The only other difference that I can think of is that I'm running against an Ice 2.1.1 candidate release, not the 2.1.0 release. If your configuration is like the above and the number of the threads in the server process is not 124 (as mine is) then I'll test against 2.1.0.

    Regards, Matthew
  • Yes, it works now,thank you very much.

    After I delete the files under node/* and registry/*, everything works fine.

    I used "application remove Simple"/"application add 'application.xml" before to redeploy the server. The same method works after I delete the files,but doesn't work before. :rolleyes:
  • benoit
    benoit Rennes, France
    Note that you should also be able to use "application upgrade 'application.xml'" to update the configuration of your deployed application from the updated XML descriptors.

    Benoit.