Welcome to the new Gigaspaces XAP forum. To recover your account, please follow these instructions.

Ask Your Question

Task Execution over the Space concurrency concerns

I was reading about task execution over the space: http://wiki.gigaspaces.com/wiki/displ...

I see that we can execute tasks asynchronously:

AsyncFuture<Integer> future = gigaSpace.execute(new MyTask())

Well, that's all good but how many tasks can XAP handle simultaneously. Is there some limit or do the tasks get queued up if they can't be executed immediately. Does this queue grow infinitely or will the execute call above block eventually?

The reason I'm asking is that I have lots of tasks to be executed simultaneously but I'm concerned about using up all the XAP threads or making some task queue grow without bounds.

Thanks for any insight on this matter.

asked 2014-07-10 23:00:08 -0600

Steve McCarthy gravatar image
edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted

The upper limit of concurrent remote activity would be number of LRMI thread pool size (128) per GSC. You can increase it to 512 on 16 core machine - that's a reasonable number.


If you have many thousands of concurrent requests that should be handled asynchronously you should consider moving into a different execution model that is more controlled (but also slower) such as event based remoting: http://docs.gigaspaces.com/xap97/even...


answered 2014-07-11 00:56:29 -0600

shay hassidim gravatar image
edit flag offensive delete link more


Thanks for the reply.

If I use event driven remoting (as you mentioned) and new tasks are added faster than they are processed, do the tasks get queued up and what is the limit to this queue?

What I would like is some way to throttle the tasks if they come in too fast. What I don't want is a task queue that just keeps on growing.

Steve McCarthy gravatar imageSteve McCarthy ( 2014-07-11 01:34:34 -0600 )edit

With the event remoting each service call controlled via a space object. This means this “queue” can grow without real control. If you want to throttle the activity limit the reduce the lrmi thread pool.

shay hassidim gravatar imageshay hassidim ( 2014-07-11 02:01:53 -0600 )edit

an additional system property to set on the GSC side is com.gs.transport_protocol.lrmi.max-conn-pool. Set is to a low number (10) in case you have multi-threaded application. It will throttle the client.

shay hassidim gravatar imageshay hassidim ( 2014-07-11 04:18:16 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2014-07-10 23:00:08 -0600

Seen: 304 times

Last updated: Jul 11 '14