Is this for testing purposes? I think there is a flaw in your design. As Dustin said, your machine is not going to be happy about 5000 concurrent IO operations unless you have 5000 cores.
Java's concurrent package is very easy to use and has low overhead-- take a look at ExecutorService. Maybe create a thread pool with the same number of threads as you have cores and submit jobs to it for the operations you want to run, for example... On Thu, Feb 25, 2010 at 3:55 PM, mariyan nenchev <[email protected]>wrote: > Hi, theese threads simulate users. I have jboss AS that manages all user > requests and for every request i need to update memcache. I will try spy > client tomorow. > > > On Thu, Feb 25, 2010 at 7:48 PM, Dustin <[email protected]> wrote: > >> >> On Feb 25, 7:21 am, mariyan nenchev <[email protected]> wrote: >> > What will happen if i create 5000 threads(5000 users update >> simultaniosly) >> > to update the cache just once at the same time? >> >> Unless your box has 5,000 cores, your application is going to fall >> apart in all kinds of other exciting ways here. It's certainly not >> going to happen all at the same time anyway. >> >> You're far better off running that work an ExecutorService. >> >> But in general, spymemcached doesn't care how many threads you're >> using. There are only practical limitations (e.g. you don't have >> 5,000 cores so you have a lot of threads waiting for a CPU to become >> available for each app thread, spymemcached thread, memcached thread, >> etc...) and small contention points while enqueuing commands. >> > > -- awl
