Thread Pool's decreasing application performance

Hi,
In my application, I need to make 10,000 threads for network calls at one instant and release the threads after downloading content.
Content downloading of individual thread consumes less than 1min.
When I try this using Timer Task and normal Threads, it works perfectly.
But after introducing ThreadPool (initial :20,000 ; maximum: 50,000) , the response has degraded.
Is there any limitations or known issues similar to this for thread pool's.
Thanks!

rock_win wrote:
In my application, I need to make 10,000 threads for network calls at one instant and release the threads after downloading content.10000 threads all doing network connects at the same time? You better contact 10000 distinct servers and have tons of network bandwidth.
You'll hit problems at that level long before the number of threads becomes a problem.
Content downloading of individual thread consumes less than 1min.
When I try this using Timer Task and normal Threads, it works perfectly.What are "normal Threads"? How many operations are you running in parallel here?
But after introducing ThreadPool (initial :20,000 ; maximum: 50,000) , the response has degraded.You want to have 10000 Threads and declare a pool with 20000 initial threads? Why?

Similar Messages

  • 100% thread pool/CPU usage prevent MII Applications from working

    Hello to all,
    our MII Applications were running on MII 11.5 (windowsserver 2003, with IIS) without any problems.
    We migrated these MII Applications  to SAP xMII Version 12.0 SP8, SAP NW 7.00 SP20, Java HotSpot(TM) 64-Bit Server VM (build 1.4.2_22-rev-b03, mixed mode).
    Since then we faced several problems that prevent the MII Applications from working, e.g.
    - 100% application thread pool usage rate
    - 100% CPU usage
    - awful lot of http connections
    Several sap support calls didn't find the root cause.
    Workaround: restart sap system weekly
    Does anyone has any idea how to go on?
    Thanks
    Simone

    Hi Mike,
    sap support told us to install this Java version.
    Furthermore SAP Note 716604 says "do not use J2SE 5.0" and "Currently, we recommend 1.4.2_24 b06".
    Any more ideas?
    Regards,
    Simone

  • Will more number of waiting threads in thread pool degrade performance?

    Hi,
    I use thread pool and set the maximum number of threads to execute. My problem is, the thread pool initiates the number of threads and these threads wait until they get a work. Will this degrade the performance (The threads do I/O operations) ??

    Threads waiting for work will not degrade performance. If your work involves those threads waiting for I/O then that in itself will not degrade performance either (as long as they block and don't poll of course).
    All live threads consume resources however so if you are short on threads or memory then don't create too many of them.
    Pre-starting a large number of threads in a pool can cause a startup delay of course. Generally you should let the pool create threads as needed until it gets to the core pool size.

  • Low Application Performance due to AM connection pooling configuration

    Hi All,
    My application performance is too slow due to default App module connection pooling parameters. I started exploring on these parameters in oracle documentation and was stopped due to some doubts.
    The below link is actually the one from which I'm doing the configuration.
    http://docs.oracle.com/cd/E21764_01/web.1111/b31974/bcampool.htm
    1. I want to know what value should be in Weblogic server --> Maximum capacity (I think they confused me a little saying it can be equal to AM's Maximum Pool Size, Maximum Available Size, Minimum Available Size).
    2. Then the AM's Initial pool size should be equal to the weblogic's Initial Capacity. I have 10 AM, if I'm setting 100 in each AM, then the corresponding weblogic's initial capacity should be equal to 100 or 100 X 10. Please clarify this.
    Thanks.

    You post give no information which connects the pooling parameter to 'low' performance. Have you checked where all the time is consumed? Which method or part of the application consumes the most time. Before you can't answer these questions you can't link the problem to am pooling.
    Here are some pointers
    http://andrejusb.blogspot.de/2011/10/experimenting-with-adf-bc-application.html
    http://andrejusb.blogspot.de/2012/01/adf-performance-marathon-22-hours.html
    and there are some more articles available on Andrejus's blog...
    Timo

  • Decreased Battery Performance when using SL. Apple states I am alone..

    This thread is mainly aimed at people that are using a mid 2009 unibody MacBook Pro 13" or upwards that came pre-installed with Leopard. Since upgrading to Snow leopard have you noticed a significant decrease in how long the battery lasts while using the machine in the same fashion?
    Am I alone? I first reported this issue to the Dutch customer service team back in October 2009 and since then have fought it all the way to make Apple admit that there is a problem with a minority of customers. To this day according to executive customer relations, I am the only person who has reported this issue to them. I find this hard to believe as there is a mass of information/threads/blogs etc on the internet with many people complaining about the same issue.
    The following is an email I sent to the [email protected] email as a last resort.
    Dear Steve,
    I am writing to you as a last resort hoping that my complaint will be dealt with professionally as I have actually given up all hope with the Apple customer service. I do not expect that you will personally read this letter but I just trust that someone will care and pass this to someone that will treat my complaint seriously as I really am losing all faith with Apple.
    I purchased a brand new Macbook Pro 13" mid 2009 model at the end of June 2009. Around 3 weeks after I purchased the machine I received a message from Apple stating that I was eligible for a copy of Snow Leopard as it was compatible with my machine and because I had just purchased a new Mac. I upgraded the Mac to Snow Leopard without any issues. It wasn't until a few weeks later that I noticed a massive reduction in battery performance. When I ran the machine on Leopard I would easily get the advertised 7 hour battery life while doing basic web browsing with all the battery settings set to the Mac default recommended settings. On Snow Leopard I would not get anything more than 4 hours completing the same tasks.
    I contacted Apple about this and was provided with the following reference number XXXXXXXXX I was basically told that I should monitor what I was doing etc and try using the screen on the lowest setting to see if this would improve the performance, it did not. I am a busy man and work in graphic design so unfortunately I put up with the battery issue until my Hard Drive decided to die in April. I contacted Apple again about this and was again provided with a reference number XXXXXXXXXX this time I was asked to do various steps to help fix the machine which did not work. Eventually I had the machine booked in for repair. When the machine was booked in for repair I also stated that I would like the battery issue addressed once and for all as I still only get around 4 hours charge. I was told this would be looked into. After 2 weeks of having no machine (and losing out on work) I received my Mac back with a new Hard drive installed as the old one was corrupted. I asked the Apple employee if my battery had been addressed and it had not. I refused to except my machine back as the battery issue was not resolved. After another 2 weeks of not having my Mac (more loss of work on my account) I received it back this time a new battery and motherboard had been installed.
    I returned to my office and reinstalled Snow Leopard, my Adobe Master Collection and charged to 100% I then tested the machine on battery. Again I received no more than 4 hours using BELOW recommended Mac battery settings. I contacted Apple again by telephone (another 0900 number call at my expense) and was messed around left right and centre. The employee on the telephone did not know what to do so transferred me to one of the Mac level 2 agents. I have never been spoken to so rudely and was even told that the only way I could expect 7 hours battery life from a MacBook Pro 2009 model is to use it with the lid closed. Ridiculous hey? I was also even told by one of the previous customer service agents that I could try using the machine with the battery disconnected. Even more ridiculous considering it is a unibody model.
    At this point I started doing research on the issue and found that I was far from alone with the battery issue. I have found numerous people suffering from the same issue. Below are a few links containing the same issue.
    http://discussions.apple.com/thread.jspa?messageID=10337524&#10337524
    http://discussions.apple.com/thread.jspa?messageID=11365892&#11365892
    http://forums.cnet.com/5208-21565_102-0.html?threadID=357366
    At this point I decided to try something different, something that was not recommended or mentioned by any Apple employee, sales or technical. I decided to reformat the HD and install Leopard back on the on the machine. I then completed a battery test and low and behold my 7 hours of battery life were fully back. I think this can safely say that the issue is clearly with the OSX and not the hardware.
    I then contacted Apple customer service by phone (more 0900 numbers at my expense) I spoke to a senior Applecare advisor called XXXXX XXXXXXXX and explained my issue in full. I told xxxxxxx that I wanted this matter looking into and that I wanted a machine that would give me what is advertised using Snow Leopard, as know where on the Apple site or in the Snow Leopard documentation does it state ' Expect to lose 3 hours '
    I provided xxxxxxxx with a system info file and he sent it the Apple engineering team. A week went by and I received an email from him with the report from engineering. Engineering basically blamed it ALL on 3rd party applications, they even blamed it on the weather widget stating that it is constantly updating and will drain power. My remote access software was also blamed which was not even running in the background.
    1: The weather widget updates when you select it not constantly.
    2: The weather widget is by DEFAULT installed on a machine so thus would be classed as an Apple product in my opinion.
    That evening I decided to reformat my HD and reinstall Snow Leopard. This time I installed ONLY Apple software updates and nothing else. I then tested the battery again (getting very boring now) using the same settings as previous tests. This time I managed to have 4 hrs and 15 mins. Just 15 minutes more than what I had previously had. I then contacted xxxxxxx again and provided him with another system information file from the clean install. I explained that I had tested this with just the airport on and basic web browsing on various sites (my exact words) Another week went by and I received a call from xxxxxxx with his report from engineering. He said that Engineering wanted to know if I had tested this with basic web browsing or sat on Youtube or other flash based video streaming sites for 4 hours as this could reduce the battery life.
    As you could imagine I was furious. I repeated myself to xxxxxxx about my tests and was told that he would go back to engineering. I received another call from xxxxxxx stating that engineering are looking into it. I asked how long it would take for an answer on this and we agreed on a 2 week time frame. It is now over 2 weeks and I have sent 2 emails to xxxxxx and still have not received a reply.
    This issue has been going on since October 2009 when I first reported it. We are now in July 2010 and I am still suffering with this, as you can imaging this is unacceptable and not what one would expect from a company like Apple. My complaints summarized are below, I believe the obvious speak for themselves.
    1: There is no disclaimer on the Apple site stating that Snow Leopard will decrease the performance of a battery on a machine that did not come preinstalled with Snow Leopard. Neither is this information provided on the installation PDF instructions that come with the Snow Leopard disc.
    2: If there were such a disclaimer on the Apple site then why would I have my battery and motherboard replaced by the Apple repair team when there was clearly nothing wrong with them in the first place. Why was I never told this by any agent on the phone or in the Mac store? The answer seems clearly that this information is not available to the public or to Apple staff which is a big waste or my time as well as theirs.
    3: I have missed out on work because of having my Mac in for repair for a total of 4 weeks. As mentioned above there was clearly no need to have had the battery or motherboard replaced.
    4: I have spent money calling the 0900 numbers on numerous occasions simply getting passed around from Apple employee to Apple employee and still have no answer to my problem.
    5: I have wasted so much of my own time clean erasing my hard drive including zero out of sectors and reinstalling operating systems, not to mention other software and Apple updates. All of this comes to many hours of total wasted time at my expense when I could have been working.
    Where we stand now is that I am on the verge of taking legal proceedings with the Dutch Consumentenbond as this machine is not suitable to run with the Snow Leopard OSX when Apple advertise that it is.
    I expect either a full refund of my MacBook Pro 13" mid 2009 or an exchange for a Macbook Pro 13" that comes with Snow Leopard preinstalled with the disc in the box. I also expect to be compensated for my loss of time, money I have spent on the phone to Apple and the loss of work while the machine was in for unnecessary repair.
    I am really at the end of my patience with this issue and feel that I have been much more than fair with my reports, honesty and patience.
    I trust to hear from somebody soon regarding this issue so that we can finally put it to a close once and for all in a professional manor.
    Regards
    I received a phone call within 14 hours of sending the email from executive customer relations. They came back with new information from engineering but did not think it was acceptable as engineering were now blaming my battery decrease on the assumption that my apartment might be too hot this causing the CPU to run at a higher temperature making the battery decrease quicker. We both agreed that it was an unacceptable answer.
    The day after I received another call from them stating that engineering had now finished tests and came to the conclusion that when testing on Leopard and Snow Leopard on the MacBook Pro 2009 there was no difference in battery run time whats so ever. I found this hard to believe so asked exactly how the test was conducted. Was it conducted in the same fashion that I had spent the last 9 months talking about. ' Using below default energy saving settings with only airport on while completing basic web browsing '???
    They confirmed this was not the case, engineering had basically turned the machines on, turned the screen right down to 1 bar and left them on screen saver over night. As you can imaging I was speechless (for a few seconds)
    Apple seem consistent on NOT admitting that there is an issue with battery performance for a minority of customers. As is stands now engineering in Europe have now passed the case over to engineering in the US for further ' in-depth ' tests.
    I know there are people out there that are suffering the same issues as myself and I welcome you to please contact me with your experiences. As the more of us that complain about this make it harder for Apple to deny this and brush it under the carpet.
    Please feel free to reply to this thread or email me directly on [email protected]

    Thomas A Reed wrote:
    I mean this in the kindest way but please read the post
    Please, nobody's going to waste their time reading all that! I don't know what you possibly could have said about this issue that took up so much space, but if you can't express it more concisely, it's probably not worth reading.
    I have used SL on both a unibody MBP and an older MBP. On the older MBP, when I upgraded from Leopard to SL, I got a noticeable increase in battery life immediately. I have no such comparison on the unibody MBP, since it had SL installed to begin with, but I'll put it this way: I haven't come close to running out of power on it. I used it once for about 4 hours and still had more than a 1/3 charge. I could have easily used it for another couple hours, at least. And this was with a 17" MBP, which uses more power than your 13", and without much in the way of battery-saving going on. (Screen at full brightness, AirPort on and in use, Bluetooth on, etc.)
    It's difficult to say that SL is the problem when it clearly isn't for everyone. What your problem is, I don't know, but maybe if you posted a more concise question you'd get some answers.
    I think ..
    This thread is mainly aimed at people that are using a mid 2009 unibody MacBook Pro 13" or upwards that came pre-installed with Leopard.....
    at the beginning of the thread I made it pretty clear, if you are not affected by this then I'm happy for you, but then the thread is clearly not aimed at you. I can guarantee that I have tested this exactly the same way I did with Leopard and there is a significant decrease. I also know there are people out there that have gained battery life but there have also been many threads containing people who have lost battery life.

  • JRun Thread Pool Issue

    I'm running CF 9.0.1 on Ubuntu on an "Medium" Amazon EC2 instance. CF has been crashing intermittently (several times per day). At such times, running top gets me this (or something similar):
    PID
    USER
    PR
    NI
    VIRT
    RES
    SHR
    S
    %CPU
    %MEM
    TIME+COMMAND                                                                                                   
    15855
    wwwrun
    20
    0
    1762m
    730m
    20m
    S
    99.3
    19.4
    13:22.96 coldfusion9
    So, it's obviously consuming most of the server resources. The following error has been showing up in my cfserver.log in the leadup to each crash:
    java.lang.RuntimeException: Request timed out waiting for an available thread to run. You may want to consider increasing the number of active threads in the thread pool.
    If I run /opt/coldfusion9/bin/coldfusion status, I get:
    Pg/Sec  DB/Sec  CP/Sec  Reqs  Reqs  Reqs  AvgQ   AvgReq AvgDB  Bytes  Bytes
    Now Hi  Now Hi  Now Hi  Q'ed  Run'g TO'ed Time   Time   Time   In/Sec Out/Sec
    0   0   0   0   -1  -1  150   25    0     0      -1352560      0      0
    In the administrator, under Server Settings > Request Tuning, the setting for Maximum number of simultaneous Template requests is 25. So this makes sense so far. I could just increase the thread pool to cover these sort of load spikes. I could make it 200. (Which I did just now as a test.)
    However, there's also this file /opt/coldfusion9/runtime/servers/coldfusion/SERVER-INF/jrun.xml. And some of the settings in there appear to conflict. For example, it reads:
    <service class="jrunx.scheduler.SchedulerService" name="SchedulerService">
      <attribute name="bindToJNDI">true</attribute>
      <attribute name="activeHandlerThreads">25</attribute>
      <attribute name="maxHandlerThreads">1000</attribute>
      <attribute name="minHandlerThreads">20</attribute>
      <attribute name="threadWaitTimeout">180</attribute>
      <attribute name="timeout">600</attribute>
    </service>
    Which a) has fewer active threads (what does this mean?), and b) has a max threads that exceed the simultaneous request limit set in the admin. So, I'm not sure. Are these independent configs that need to be made to match manually? Or is the jrun.xml file supposed to be written by the CF Admin when changes are made there? Hmm. But maybe this is different because presumably the CF Scheduler should only use a subset of all available threads, right...so we'd always have some threads for real live users. We also have this in there:
    <service class="jrun.servlet.http.WebService" name="WebService">
      <attribute name="port">8500</attribute>
      <attribute name="interface">*</attribute>
      <attribute name="deactivated">true</attribute>
      <attribute name="activeHandlerThreads">200</attribute>
      <attribute name="minHandlerThreads">1</attribute>
      <attribute name="maxHandlerThreads">1000</attribute>
      <attribute name="mapCheck">0</attribute>
      <attribute name="threadWaitTimeout">300</attribute>
      <attribute name="backlog">500</attribute>
      <attribute name="timeout">300</attribute>
    </service>
    This appears to have changed when I changed the CF Admin setting...maybe...but it's the activeHandlerThreads that matches my new maximum simulataneous requests setting...rather than the maxHandlerThreads, which again exceeds it. Finally, we have this:
    <service class="jrun.servlet.jrpp.JRunProxyService" name="ProxyService">
      <attribute name="activeHandlerThreads">200</attribute>
      <attribute name="minHandlerThreads">1</attribute>
      <attribute name="maxHandlerThreads">1000</attribute>
      <attribute name="mapCheck">0</attribute>
      <attribute name="threadWaitTimeout">300</attribute>
      <attribute name="backlog">500</attribute>
      <attribute name="deactivated">false</attribute>
      <attribute name="interface">*</attribute>
      <attribute name="port">51800</attribute>
      <attribute name="timeout">300</attribute>
      <attribute name="cacheRealPath">true</attribute>
    </service>
    So, I'm not certain which (if any) of these I should change and what exactly the relationship is between maximum requests and maximum threads. Also, since several of these list the maxHandlerThreads as 1000, I'm wondering if I should just set the maximum simultaneous requests to 1000. There must be some upper limit that depends on available server resources...but I'm not sure what it is and I don't really want to play around with it since it's a production environment.
    I'm not sure if it pertains to this issue at all, but when I run a ps aux | grep coldfusion I get the following:
    wwwrun   15853  0.0  0.0   8704   760 pts/1
    S
    20:22   0:00 /opt/coldfusion9/runtime/bin/coldfusion9 -jar jrun.jar -autorestart -start coldfusion
    wwwrun   15855  5.4 18.2 1678552 701932 pts/1  
    Sl
    20:22   1:38 /opt/coldfusion9/runtime/bin/coldfusion9 -jar jrun.jar -start coldfusion
    There are always these two and never more than these two processes. So there does not appear to be a one-to-one relationship between processes and threads. I recall from an MX 6.1 install I maintained for many years that additional CF processes were visible in the process list. It seemed to me at the time like I had a process for each thread...so either I was wrong or something is quite different in version 9 since it's reporting 25 running requests and only showing these two processes. If a single process can have multiple threads in the background, then I'm given to wonder why I have two processes instead of one...just curious.
    So, anyway, I've been experimenting while composing this post. As noted above I adjusted the maximum simulataneous requests up to 200. I was hoping this would solve my problem, but CF just crashed again (rather it slogged down and requests started timing out...so effectively "crashed"). This time, top looked similar (still consuming more than 99% of the CPU), but CF status looked different:
    Pg/Sec  DB/Sec  CP/Sec  Reqs  Reqs  Reqs  AvgQ   AvgReq AvgDB  Bytes  Bytes
    Now Hi  Now Hi  Now Hi  Q'ed  Run'g TO'ed Time   Time   Time   In/Sec Out/Sec
    0   0   0   0   -1  -1  0     150   0     0      0      0      0      0
    Obviously, since I'd increased the maximum simultaneous requests, it was allowing more requests to run simultaneously...but it was still maxing out the server resources.
    Further experiments (after restarting CF) showed me that the server became unusably slogged after about 30-35 "Reqs Run'g", with all additional requests headed for an inevitible timeout:
    Pg/Sec  DB/Sec  CP/Sec  Reqs  Reqs  Reqs  AvgQ   AvgReq AvgDB  Bytes  Bytes
    Now Hi  Now Hi  Now Hi  Q'ed  Run'g TO'ed Time   Time   Time   In/Sec Out/Sec
    0   0   0   0   -1  -1  0     33    0     0      -492   0      0      0
    So, it's clear that increasing the maximum simultaneous requests has not helped. I guess what it comes down to is this: What is it having such a hard time with? Where are these spikes coming from? Bursts of traffic? On what pages? What requests are running at any given time? I guess I simply need more information to continue troubleshooting. If there are long-running requests, or other issues, I'm not seeing it in the logs (although I do have that option checked in the admin). I need to know which requests exactly are those responsible for these spikes. Any help would be much appreciated. Thanks.
    ~Day

    I really appreciate your help. However, I haven't been able to find the JRun Thread settings you describe above.
    Under Request Tuning, I see:
    Server Settings > Request Tuning
    Request Limits
    Maximum number of simultaneous Template requests
      Restricts the number of simultaneously processed requests. Use this setting to increase overall system performance for heavy load applications. Requests beyond the specified limit are queued. On Standard Edition, you must restart ColdFusion to enable this setting. 
    Maximum number of simultaneous Flash Remoting requests
      The number of Flash Remoting requests that can be processed concurrently.
    Maximum number of simultaneous Web Service requests
      The number of Web Service requests that can be processed concurrently.
    Maximum number of simultaneous CFC function requests
      The number of ColdFusion Component methods that can be processed concurrently via HTTP. This does not affect invocation of CFC methods from within CFML, only methods requested via an HTTP request.
    Tag Limit Settings
    Maximum number of simultaneous Report threads
      The maximum number of ColdFusion reports that can be processed concurrently.
    Maximum number of threads available for CFTHREAD
      The maximum number of threads created by CFTHREAD that will be run concurrently. Threads created by CFTHREAD in excess of this are queued.  On Standard Edition, the maximum limit is 10. 
    And under Java and JVM, I see:
    Server Settings > Java and JVM
        Java and JVM settings control the way ColdFusion starts the Java Virtual Machine when it starts.  You can control settings like what classpaths are used and how memory is allocated as well as add custom command line arguments.  Changing these settings requires restarting ColdFusion.  If you enter an incorrect setting, ColdFusion may not restart properly. 
       Backups of the jvm.config file are created when you hit the submit button. You can use this backup to restore from a critical change. 
       Java Virtual Machine Path
      Specifies the location of the Java Virtual Machine.
       Minimum JVM Heap Size (MB)         Maximum JVM Heap Size  (MB)       
       The Memory Size settings determine the amount of memory that the JVM can use for programs and data. 
       ColdFusion Class Path
      Specifies any additional class paths for the JVM, with multiple directories separated by  commas.
       JVM Arguments
      -server -Dsun.io.useCanonCaches=false -XX:MaxPermSize=192m -XX:+UseParallelGC -Xbatch -Dcoldfusion.rootDir={application.home}/../ -Dcoldfusion.libPath={application.home}/../lib
      Specifies any specific JVM initialization options, separated by spaces.
    I did go take a look at FusionReactor and found it's not free (which would be fine, of course, if it would actually help). It looks like there's a fully functional demo, which is cool...but I've haven't been able to get it to install yet, so we'll see.
    Thanks again!
    ~Day
    (By the way, I've cross-posted this inquiry on StackOverflow. So if you're able to help me arrive at a solution you might want to answer there as well.)

  • Pattern for Thread Pool?

    Hi
    i want to build a kind of download manager. The application should be able to handle some concurrent threads, each representing a download in progress.
    I thought i might be more efficient to reuse a download thread after the download has ended as to create a new thread each time (like the connection object for db queries). Is this right? If yes, i thought to build a thread pool that serves a limited number of threaded download objects as requested (am I on the right way?).
    Now, I have to basic problems: (a) is it right, that, if the run() method of a thread has ended, the whole thread gets destroved? if yes, how should i prevent the thread from being destroyed, so i can reuse it later on? Second (b) how would that pool mechnism look like, means, there must be some kind of vector where i put in and take out the threads.
    As you see, these are basic "pool" technique questions. So, I thought, maybe there is a design pattern that would give me the basic mechanism, Does anyone know such a pattern?
    Thanks for your help
    josh

    I thought i might be more efficient to reuse a
    download thread after the download has ended as to
    create a new thread each time (like the connection
    object for db queries). Is this right? If yes, iIt may be right, if creating new threads is wasting enough CPU cycles to justify the complication of a thread pool. Maybe for a high-load server it would be more efficient. You'll have to figure that out for your own specific application.
    Another good use for thread pools is to avoid putting time-consuming operations in ActionListeners, etc. Instead you can have them pass the task off to a thread pool, keeping the GUI responsive.
    Now, I have to basic problems: (a) is it right, that,
    if the run() method of a thread has ended, the whole
    thread gets destroved? if yes, how should i prevent
    the thread from being destroyed, so i can reuse it
    later on? Second (b) how would that pool mechnism look
    like, means, there must be some kind of vector where i
    put in and take out the threads. (a) You are right. Therefore, the worker threads should not exit their run() methods until interrupted. (b) Worker threads could check a job queue (containing Runnables, perhaps) and if there are none, they should wait() on some object. When another thread adds a new job to the queue, it should call notify() on the same object, thus waking up one of the worker threads to perform the task.
    I wrote a thread pool once, just as an exercise. You will run into a number of problems and design issues (such as, what should the worker threads do when interrupted, exit immediately or clear the job queue and then exit?) If you have any more questions, ask in this thead.
    Krum

  • Log of execute thread pool status

    hi guys
    We are performing some performance analysis on a application and would
    like to log the status of the execute thread pool periodically to a
    log file.
    The performance tests run for a extended period of time and hence
    console is not proving to be effective in monitoring the behaviour
    over a long period of time.
    What other alternatives exist if I want to do this.
    Thanks for your time
    anand

    thanks guys,
    I found an answer in one of rob wollens old post.
    http://dev2dev.bea.com/resourcelibrary/utilitiestools/index.jsp
    Sorry for posting without doing a little research
    ~anand

  • Optimization of Thread Pool Executor

    Hi,
    I am using ThreadPoolexecutor by replacing it with legacy Thread.
    I have created executor as below:
    pool = new ThreadPoolExecutor(coreSize, size, 0L, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<Runnable>(coreSize), new CustomThreadFactory(name),new CustomRejectionExecutionHandler());
           pool.prestartAllCoreThreads();
    here core size is maxpoolsize/5
    and i have prestarted all the core threads on start up of application roughly around 160 threads.
    in legacy design we were creating and starting around 670 threads.
    But the point is even after using Executor and creating and replacing  legacy design we are not getting much better results.
    For results memory management we are using top command to see memory usage
    and for time we have placed loggers of System.currentTime in millis to check the usage.
    Please tell how to optimize this design
    Thanks & Regards,
    tushar

    The first step is to decide what you want to optimize. I'm guessing you want to minimize the total elapsed time for the job to run, but anyway that's your first step. Determine what you're optimizing. Then measure the performance of the job, with respect to that metric, for various pool sizes, and see what happens.
    However I'm not sure why you expected that rewriting the application to use the ThreadPoolExecutor would improve the runtime performance of the job. I would expect it might simplify the code and make it easier for future programmers to understand, but it's possible that your thread pool implementation performs just as well.

  • Can I give a certain JSP its own thread pool?

    Hey all,
              The application I'm working on needs to give a certain JSP its own thread pool so that it does not effect the performance of the other pools. I can create the new thread pool and am trying to set the value in web.xml. Here's my entry:
              <servlet>
              <servlet-name>??????</servlet-name>
              <jsp-file>/search/*.jsp</jsp-file>
              <init-param>
                   <param-name>wl-dispatch-policy</param-name>
              <param-value>search</param-value>
              </init-param>
              </servlet>
              Since this is just a JSP can you tell me what I should set the <servlet-name> to?
              Thanks for the help.

    you could also try it here:
    http://web.mac.com/madmax019/0/mx/Favicons%20%26%20URL%20Icons.html
    max

  • BackupVirtualDeviceFile::RequestDurableMedia: Flush failure on backup device 'CA_BAB_MSSQL_e85860_10001_2085d987_ERP_DATABASE_ST_1'. Operating system error 995(The I/O operation has been aborted because of either a thread exit or an application reque

    hello,
    i getting the following error message in event id while backing up my SQL db by third party backing tool
    BackupVirtualDeviceFile::RequestDurableMedia: Flush failure on backup device 'CA_BAB_MSSQL_e85860_10001_2085d987_ERP_DATABASE_ST_1'. Operating system error 995(The I/O operation has been aborted because of either a thread exit or an application request.).
      <Data>995(The I/O operation has been aborted because of either a thread exit or an application request.)
    please suggest the solution.

    Hi pulkit,
    According to your description, the actual error could be caused by but not limited to the following issues: Memory issues, Third Party issues, or SQL Server issues and so on. However, as shanky post, if you use an external or third party backup tool like
    NetBackup, BackupExec, or one of the many other tools available for backing up SQL Server databases without having to write your own backup scripts, and the error occurs. You need to check if there are some issues about your VDI or SQLVDI.DLL. Meanwhile,
    you also need to troubleshooting Memory Issue or the third tool issue. For more information about troubleshooting the error 995 when backing up database via the third party tool. You can review the following blog.
    https://support.software.dell.com/kb/SOL14674
    In addition, the error may include additional text from the operating system indicating that the disk is full. When performing a backup or restore operation with third-party backup software an additional message may occur indicating that the backup failed.
    Perform the following tasks as appropriate:
     1. Review the underlying system error messages and SQL Server error messages preceding this one to identify the cause of the failure.
     2. Ensure that the backup and restore medium has sufficient space.
     3. Correct any errors raised by third-party backup and restore software.
    There is also detail about backing up database via T-SQL statement /GUI, you can review the following article.
    http://technet.microsoft.com/en-us/library/ms187510.aspx
    Regards,
    Sofiya Li
    Sofiya Li
    TechNet Community Support

  • JNDI lookup fails in a thread created by J2EE application on WAS 8.0.0.4 running on Red Hat Enterprise Server 5.8(2.6.18-308.e15).

    I am using Jackrabbit Repository (jcr's implementation) as backend in my Web Appl.Whose data persists on Oracle Database. To make connection with Oracle database jackrabbit provide provision of JNDI Lookup to read the data source defined in WAS (using WAS 8.0.0.4 as App Server).
    I am able to perform JNDI Lookup everywhere in my application,But in a flow where i am creating a Thread using Java Concurrent Api and insidethread's call() method when I am trying for JNDI Look following exception occurs –
    [8/20/13 10:57:35:163 IST] 000000dd System Out     O ERROR 20-08 10:57:35,163 (DatabaseFileSystem.java:init:209)            failed to initialize file system
    javax.jcr.RepositoryException: JNDI name not found: java:comp/env/jdbc/ofsds
    at org.apache.jackrabbit.core.util.db.ConnectionFactory.getJndiDataSource(ConnectionFactory.java:295)
    at org.apache.jackrabbit.core.util.db.ConnectionFactory.createDataSource(ConnectionFactory.java:233)
    at org.apache.jackrabbit.core.util.db.ConnectionFactory.getDataSource(ConnectionFactory.java:166)
    at org.apache.jackrabbit.core.fs.db.DbFileSystem.getDataSource(DbFileSystem.java:226)
    at org.apache.jackrabbit.core.fs.db.DatabaseFileSystem.init(DatabaseFileSystem.java:190)
    at org.apache.jackrabbit.core.config.RepositoryConfigurationParser$6.getFileSystem(RepositoryConfigurationParser.java:1057)
    at org.apache.jackrabbit.core.config.RepositoryConfig.getFileSystem(RepositoryConfig.java:911)
    at org.apache.jackrabbit.core.RepositoryImpl.<init>(RepositoryImpl.java:285)
    at org.apache.jackrabbit.core.RepositoryImpl.create(RepositoryImpl.java:605)
    at org.apache.jackrabbit.core.TransientRepository$2.getRepository(TransientRepository.java:232)
    at org.apache.jackrabbit.core.TransientRepository.startRepository(TransientRepository.java:280)
    at org.apache.jackrabbit.core.TransientRepository.login(TransientRepository.java:376)
    at com.mmpnc.icm.server.repository.RepositoryStartupService.newSession(RepositoryStartupService.java:408)
    at com.mmpnc.icm.server.repository.RepositoryStartupService.newSession(RepositoryStartupService.java:355)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:60)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
    at java.lang.reflect.Method.invoke(Method.java:611)
    at org.jboss.seam.util.Reflections.invoke(Reflections.java:22)
    at org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:31)
    at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56)
    at org.jboss.seam.transaction.RollbackInterceptor.aroundInvoke(RollbackInterceptor.java:28)
    at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
    at org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:44)
    at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
    at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:107)
    at org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:166)
    at org.jboss.seam.intercept.JavaBeanInterceptor.invoke(JavaBeanInterceptor.java:102)
    at com.mmpnc.icm.server.repository.RepositoryStartupService_$$_javassist_1.newSession(RepositoryStartupService_$$_javassist_1.java)
    at com.mmpnc.icm.server.repository.ICMHouseKeepingSessionManager.create(ICMHouseKeepingSessionManager.java:37)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:60)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
    at java.lang.reflect.Method.invoke(Method.java:611)
    at org.jboss.seam.util.Reflections.invoke(Reflections.java:22)
    at org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:31)
    at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56)
    at org.jboss.seam.transaction.RollbackInterceptor.aroundInvoke(RollbackInterceptor.java:28)
    at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
    at org.jboss.seam.core.BijectionInterceptor.aroundInvoke(BijectionInterceptor.java:77)
    at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
    at org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:44)
    at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
    at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:107)
    at org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:166)
    at org.jboss.seam.intercept.JavaBeanInterceptor.invoke(JavaBeanInterceptor.java:102)
    at com.mmpnc.icm.server.repository.ICMHouseKeepingSessionManager_$$_javassist_8.create(ICMHouseKeepingSessionManager_$$_javassist_8.java)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:60)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
    at java.lang.reflect.Method.invoke(Method.java:611)
    at org.jboss.seam.util.Reflections.invoke(Reflections.java:22)
    at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:138)
    at org.jboss.seam.Component.callComponentMethod(Component.java:2171)
    at org.jboss.seam.Component.callCreateMethod(Component.java:2094)
    at org.jboss.seam.Component.newInstance(Component.java:2054)
    at org.jboss.seam.Component.getInstance(Component.java:1948)
    at org.jboss.seam.Component.getInstance(Component.java:1910)
    at org.jboss.seam.Component.getInstance(Component.java:1904)
    at org.jboss.seam.Component.getInstanceInAllNamespaces(Component.java:2271)
    at org.jboss.seam.Component.getValueToInject(Component.java:2223)
    at org.jboss.seam.Component.injectAttributes(Component.java:1663)
    at org.jboss.seam.Component.inject(Component.java:1481)
    at org.jboss.seam.core.BijectionInterceptor.aroundInvoke(BijectionInterceptor.java:61)
    at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
    at org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:44)
    at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
    at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:107)
    at org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:166)
    at org.jboss.seam.intercept.JavaBeanInterceptor.invoke(JavaBeanInterceptor.java:102)
    at com.mmpnc.icm.server.repository.ICMHouseKeepingRepository_$$_javassist_7.create(ICMHouseKeepingRepository_$$_javassist_7.java)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:60)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
    at java.lang.reflect.Method.invoke(Method.java:611)
    at org.jboss.seam.util.Reflections.invoke(Reflections.java:22)
    at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:138)
    at org.jboss.seam.Component.callComponentMethod(Component.java:2171)
    at org.jboss.seam.Component.callCreateMethod(Component.java:2094)
    at org.jboss.seam.Component.newInstance(Component.java:2054)
    at org.jboss.seam.Component.getInstance(Component.java:1948)
    at org.jboss.seam.Component.getInstance(Component.java:1910)
    at org.jboss.seam.Component.getInstance(Component.java:1904)
    at org.jboss.seam.Component.getInstanceInAllNamespaces(Component.java:2271)
    at org.jboss.seam.Component.getValueToInject(Component.java:2223)
    at org.jboss.seam.Component.injectAttributes(Component.java:1663)
    at org.jboss.seam.Component.inject(Component.java:1481)
    at org.jboss.seam.core.BijectionInterceptor.aroundInvoke(BijectionInterceptor.java:61)
    at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
    at org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:44)
    at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
    at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:107)
    at org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:166)
    at org.jboss.seam.intercept.JavaBeanInterceptor.invoke(JavaBeanInterceptor.java:102)
    at com.mmpnc.icm.server.repository.ICMHouseKeepingManager_$$_javassist_6.create(ICMHouseKeepingManager_$$_javassist_6.java)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:60)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
    at java.lang.reflect.Method.invoke(Method.java:611)
    at org.jboss.seam.util.Reflections.invoke(Reflections.java:22)
    at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:138)
    at org.jboss.seam.Component.callComponentMethod(Component.java:2171)
    at org.jboss.seam.Component.callCreateMethod(Component.java:2094)
    at org.jboss.seam.Component.newInstance(Component.java:2054)
    at org.jboss.seam.Component.getInstance(Component.java:1948)
    at org.jboss.seam.Component.getInstance(Component.java:1910)
    at org.jboss.seam.Component.getInstance(Component.java:1904)
    at org.jboss.seam.Component.getInstance(Component.java:1899)
    at com.mmpnc.icm.server.concurrent.PerformCloseTask.call(PerformCloseTask.java:136)
    at com.mmpnc.icm.server.concurrent.PerformCloseTask.call(PerformCloseTask.java:1)
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:314)
    at java.util.concurrent.FutureTask.run(FutureTask.java:149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:897)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:919)
    at java.lang.Thread.run(Thread.java:770)
    Caused by:
    javax.naming.ConfigurationException: A JNDI operation on a "java:" name cannot be completed because the server runtime is not able to associate the operation's thread with any J2EE application component.  This condition can occur when the JNDI client using the "java:" name is not executed on the thread of a server application request.  Make sure that a J2EE application does not execute JNDI operations on "java:" names within static code blocks or in threads created by that J2EE application.  Such code does not necessarily run on the thread of a server application request and therefore is not supported by JNDI operations on "java:" names. [Root exception is javax.naming.NameNotFoundException: Name comp/env/jdbc not found in context "java:".]
    at com.ibm.ws.naming.java.javaURLContextImpl.throwExceptionIfDefaultJavaNS(javaURLContextImpl.java:522)
    at com.ibm.ws.naming.java.javaURLContextImpl.throwConfigurationExceptionWithDefaultJavaNS(javaURLContextImpl.java:552)
    at com.ibm.ws.naming.java.javaURLContextImpl.lookupExt(javaURLContextImpl.java:481)
    at com.ibm.ws.naming.java.javaURLContextRoot.lookupExt(javaURLContextRoot.java:485)
    at com.ibm.ws.naming.java.javaURLContextRoot.lookup(javaURLContextRoot.java:370)
    at org.apache.aries.jndi.DelegateContext.lookup(DelegateContext.java:161)
    at javax.naming.InitialContext.lookup(InitialContext.java:436)
    at org.apache.jackrabbit.core.util.db.ConnectionFactory.getJndiDataSource(ConnectionFactory.java:280)
    ... 114 more
    Caused by:
    javax.naming.NameNotFoundException: Name comp/env/jdbc not found in context "java:".
    at com.ibm.ws.naming.ipbase.NameSpace.getParentCtxInternal(NameSpace.java:1969)
    at com.ibm.ws.naming.ipbase.NameSpace.retrieveBinding(NameSpace.java:1376)
    at com.ibm.ws.naming.ipbase.NameSpace.lookupInternal(NameSpace.java:1219)
    at com.ibm.ws.naming.ipbase.NameSpace.lookup(NameSpace.java:1141)
    at com.ibm.ws.naming.urlbase.UrlContextImpl.lookupExt(UrlContextImpl.java:1436)
    at com.ibm.ws.naming.java.javaURLContextImpl.lookupExt(javaURLContextImpl.java:477)
    ... 119 more

    Okay "damorgan", you seem to have me confused with a newbie. All I'm posting is the info that I got from my Sys Admin on the fix to my problem I encountered when trying to install Oracle 11g (11.2.0.0) on Red Hat Linux Enterprise 5. Since we're mouting onto an NFS, these are the steps he took. I'm not trying to "hide" information or post as little as possible. What other info do you want? I don't know what you are referring to when you mention "Filer, make, model, software version"? Please elaborate. I was just trying to post to others that may have encountered this problem, and I get somewhat attacked by you. I don't assume anyone can read my mind (especially you).

  • Custom thread pool for Java 8 parallel stream

    It seems that it is not possible to specify thread pool for Java 8 parallel stream. If that's so, the whole functionality is useless in most of the situations. The only situation I can safely use it is a small single threaded application written by one person.
    In all other cases, if I can not specify the thread pool, I have to share the default pool with other parts of the application. If someone submits a task that takes a lot of time, my tasks will get stuck. Is that correct or am I overlooking something?
    Imagine that someone submits slow networking operation to the fork-join pool. It's not a good idea, but it's so tempting that it will be happening. In such case, all CPU intensive tasks executed on parallel streams will wait for the networking task to finish. There is nothing you can do to defend your part of the application against such situations. Is that so?

    You are absolutely correct. That isn't the only problem with using the F/J framework as the parallel engine for bulk operations. Have a look http://coopsoft.com/ar/Calamity2Article.html

  • Thread pool rejecting threads when I don't think it should, ideas?

    Hi,
    I have a server application in which I only want a specific number of simultaneous requests. If the server gets more then this number it is suppose to close the connection (sends an HTTP 503 error to the client). To do this I used a fix thread pool. When I start the server and submit the max number of requests I get the expected behavior. However if I resubmit the request (within a small period of time, e.g. 1-15 seconds after the first one) I get very odd behavior in that some of the requests are rejected. For example if I set the max to 100 the first set of requests will work fine (100 requests, 100 responses). I then submit again and a small number will be rejected (I've seen it range from 1 to 15 rejected)....
    I made a small app which kind of duplicates this behavior (see below). Basically when I see is that the first time submitting requests works fine but the second time I get a rejected one. As best as I can tell none should be rejected....
    Here is the code, I welcome your thoughts or if you see something I am doing wrong here...
    <pre>
    import java.util.concurrent.*;
    import java.util.concurrent.atomic.AtomicInteger;
    public class ThreadPoolTest {
         static AtomicInteger count = new AtomicInteger();
         public static class threaded implements Runnable {
              @Override
              public void run() {
                   System.out.println("In thread: " + Thread.currentThread().getId());
                   try {
                        Thread.sleep(500);
                   } catch (InterruptedException e) {
                        System.out.println("Thread: " + Thread.currentThread().getId()
                                  + " interuptted");
                   System.out.println("Exiting run: " + Thread.currentThread().getId());
         private static int maxThreads = 3;
         private ThreadPoolExecutor pool;
         public ThreadPoolTest() {
              super();
              pool = new java.util.concurrent.ThreadPoolExecutor(
                        1, maxThreads - 1, 60L, TimeUnit.SECONDS,
                        new ArrayBlockingQueue<Runnable>(1));
         public static void main(String[] args) throws InterruptedException {
              ThreadPoolTest object = new ThreadPoolTest();
              object.doThreads();
              Thread.sleep(3000);
              object.doThreads();
              object.pool.shutdown();
              try {
                   object.pool.awaitTermination(60, TimeUnit.SECONDS);
              } catch (InterruptedException e) {
                   // TODO Auto-generated catch block
                   e.printStackTrace();
         private void doThreads() {
              int submitted = 0, rejected = 0;
              int counter = count.getAndIncrement();
              for (int x = 0; x < maxThreads ; x++) {
                   try {
                        System.out.println("Run #: " + counter + " submitting " + x);
                        pool.execute(new threaded());
                        submitted++;
                   catch (RejectedExecutionException re) {
                        System.err.println("\tRun #: " + counter + ", submission " + x
                                  + " was rejected");
                        System.err.println("\tQueue active: " + pool.getActiveCount());
                        System.err.println("\tQueue size: " + pool.getPoolSize());
                        rejected++;
              System.out.println("\n\n\tRun #: " + counter);
              System.out.println("\tSubmitted: " + (submitted + rejected));
              System.out.println("\tAccepted: " + submitted);
              System.out.println("\tRejected: " + rejected + "\n\n");
    </pre>

    First thank you for taking the time to reply, I do appreciate it.
    jtahlborn - The code provided here is a contrived example trying to emulate the bigger app as best as I could. The actual program doesn't have any sleeps, the sleep in the secondary thread is to simulate the program doing some work & replying to a request. The sleep in the primary thread is to simulate a small delay between 'requests' to the pool. I can make this 1 second and up to (at least) 5 seconds with the same results. Additionally I can take out the sleep in the secondary thread and still see the a rejection.
    EJP - Yes I am aware of the TCP/IP queue, however; I don't see that as relevant to my question. The idea is not to prevent the connection but to respond to the client saying we can't process the request (send an "HTTP 503" error). So basically if we have, say, 100 threads running then the 101st, connection will get a 503 error and the connection will be closed.
    Also my test platform - Windows 7 64bit running Java 1.6.0_24-b07 (32bit) on an Intel core i7.
    It occurred to me that I did not show the output of the test program. As the output shows below, the first set of requests are all processed properly. The second set of requests is not. The pool should have 2 threads and 1 slot in the queue, so by the time the second "request" is made at least 2 of the requests from the first call should be done processing, so I could possibly understand run 1, submit #2 failing but not submit 1.
    <pre>
    Run #: 0 submitting 0
    Run #: 0 submitting 1
    Run #: 0 submitting 2
    In thread: 8
    In thread: 9
    Exiting run: 8
    Exiting run: 9
         Run #: 0
         Submitted: 3
         Accepted: 3
         Rejected: 0
    In thread: 8
    Exiting run: 8
    Run #: 1 submitting 0
    In thread: 9
    Run #: 1 submitting 1
         Run #: 1, submission 1 was rejected
         Queue active: 1
         Queue size: 2
    Run #: 1 submitting 2
         Run #: 1
         Submitted: 3
         Accepted: 2
         Rejected: 1
    In thread: 8
    Exiting run: 9
    Exiting run: 8
    </pre>

  • Thread pool in servlet container

    Hello all,
    I'm working on this webapp that has some bad response times and I've identified an area were we could shave off a considerable amount of time. The app is invoking a component that causes data to be catched for subsequently targeted apps in the environemnt. Our app does not need to wait for a response so I'd like to make this an asyncronous call. So, how best to implement this?...I considered JMS, but started working on a solution using the Java 1.4 backport of JSR 166 (java.util.concurrent).
    I've been testing the use of a ThreadPoolExecutor, using an ArrayBlockingQueue. The work that each Runnable will perform involves a lot of waiting (the component we call invokes a web service, among a couple other distributed calls). So I figure the pool will be much larger than the queue. Our container has 35 execute threads, so I've been testing with a thread pool size of 25, and a queue of 10.
    Any thoughts on this approach? I understand that some of this work could be simplified by JMS, but if I don't need to be tied to the container, I'd prefer not to. The code if much easier to unit test, and plays nicely with our continious build integration (which runs our junit test for us and notifies on errors).
    Any thoughts are greatly appreciated...Thanks!!

    Well, if it works, that's by far the best way to go - but note that creating threads in a servlet container means those threads are outside of the container's control. Many containers will refuse to give the new threads access to the JNDI context, even, and some may prevent you from creating threads at all.

Maybe you are looking for

  • BW Upgrade Tool

    Hi All, We are developing a BW Upgrade Tool. A part of which gives information about System Landscape that may be useful before or after upgrade for a Basis Consultant. Following information is obtained as a output of the tool. So could you please gl

  • Several XML-levels (idoc) to one XML-level

    Hi. I've to create a message mapping for an order-Response (ORDERS05) Idoc to a customer-xml. Everything works fine instead of one problem. There are several XML-levels on the idoc-side which should be mapped to one-level xml on the customer-side. ..

  • Blank space between text boxes after publishing

    I have a few pages with a relatively large number of text boxes on them (perhaps 20). These are all separated by a few pixels in iWeb, but when I publish to .mac, I see quite a bit of space between them. Is this a known problem? Is there a fix? Thank

  • OPEN DATASET hangs

    Hi,          We have the SAP server and a File server connected by NFS mount. We have the ABAP program which is reading the files on the File server. Sometimes the NFS mount goes down and the ABAP program hangs on the open dataset command for more th

  • How to retrieving the content using Links

    Hi Please suggest me how to retrive content using link property. I have added link property to my Content. and i have added in internal resource path to the Link property. But my question is how access the page which is linked to my Content. How can