Re: TOMCAT memory usage : how to manage and benchmark ?
Pier Fumagalli wrote: On 28/10/02 22:40, Bojan Smojver [EMAIL PROTECTED] wrote: On Tue, 2002-10-29 at 00:31, Pier Fumagalli wrote: Those are _not_ processes, they are threads... Use a decent operating system that supports them nicely (not Linux) and you'll see the difference (how many times do I have to repeat this?)... Linux sucks :-( Ha, ha... Keep dreaming Pier ;-) Works for you? Good! Doesn't for me! :-) The Linux threads implementation is _bad_ but that does not mean that the whole thing bad. For the Fun. The kernel threads appair also in ps but I have not (yet) tried to kill one ;-) Pier -- To unsubscribe, e-mail: mailto:tomcat-dev-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:tomcat-dev-help;jakarta.apache.org -- To unsubscribe, e-mail: mailto:tomcat-dev-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:tomcat-dev-help;jakarta.apache.org
Re: TOMCAT memory usage : how to manage and benchmark ?
On Tue, 2002-10-29 at 20:15, jean-frederic clere wrote: The Linux threads implementation is _bad_ but that does not mean that the whole thing bad. I was just teasing. Anyway, have a look at this: http://marc.theaimsgroup.com/?l=linux-kernelm=103269598000900w=2 and this: http://www-124.ibm.com/developerworks/oss/pthreads/ The first link is the future (2.6 or 3.0), the second is now. For the Fun. The kernel threads appair also in ps but I have not (yet) tried to kill one ;-) There are known problems with POSIX compliance in the stock threads (this includes signal delivery and other problems). Bojan -- To unsubscribe, e-mail: mailto:tomcat-dev-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:tomcat-dev-help;jakarta.apache.org
Re: TOMCAT memory usage : how to manage and benchmark ?
jean-frederic clere [EMAIL PROTECTED] wrote: The Linux threads implementation is _bad_ but that does not mean that the whole thing bad. That's why I said works for you? Good... For our setup we _need_ threads... For the Fun. The kernel threads appair also in ps but I have not (yet) tried to kill one ;-) It can provide hours of entertainment... Last time I tried it was _so_ wicked! :-) Pier -- To unsubscribe, e-mail: mailto:tomcat-dev-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:tomcat-dev-help;jakarta.apache.org
Re: TOMCAT memory usage : how to manage and benchmark ?
Pier Fumagalli wrote: jean-frederic clere [EMAIL PROTECTED] wrote: The Linux threads implementation is _bad_ but that does not mean that the whole thing bad. That's why I said works for you? Good... For our setup we _need_ threads... So the problem is a little different: you need a JVM that uses the NGPT threads. For the Fun. The kernel threads appair also in ps but I have not (yet) tried to kill one ;-) It can provide hours of entertainment... Last time I tried it was _so_ wicked! :-) Pier -- To unsubscribe, e-mail: mailto:tomcat-dev-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:tomcat-dev-help;jakarta.apache.org -- To unsubscribe, e-mail: mailto:tomcat-dev-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:tomcat-dev-help;jakarta.apache.org
Re: TOMCAT memory usage : how to manage and benchmark ?
[EMAIL PROTECTED] [EMAIL PROTECTED] wrote: So, My first question is : why tomcat use all the memory while there is no users connected (or just one) ? The JVM allocates chunks of memory (see the -Xmx and -Xms flags by invoking java -X) and manages them... So, one user, 100 users, same thing... My second question is : how much memory is needed if I want to use tomcat with many users (500, 1000,...) ? On a 5 millions hits/day server (not running Tomcat, another servlet container since Tomcat doesn't work for us), we have the VM starting with 1 Gigs of RAM (java -server -Xmx 1024m -Xms 1024m ...) but we use half of it (roughly) to cache data from the DB... I already read in the forum Tomcat don't manage the memory, it is the JVM... so why the jvm use so many processes ? Those are _not_ processes, they are threads... Use a decent operating system that supports them nicely (not Linux) and you'll see the difference (how many times do I have to repeat this?)... Linux sucks :-( Pier -- To unsubscribe, e-mail: mailto:tomcat-dev-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:tomcat-dev-help;jakarta.apache.org
Re: TOMCAT memory usage : how to manage and benchmark ?
Pier Fumagalli wrote: [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: So, My first question is : why tomcat use all the memory while there is no users connected (or just one) ? You should first see if your application is not eating memory. My second question is : how much memory is needed if I want to use tomcat with many users (500, 1000,...) ? The question should be 'how many concurrents users' ? On a 5 millions hits/day server (not running Tomcat, another servlet container since Tomcat doesn't work for us), we have the VM starting with 1 Gigs of RAM (java -server -Xmx 1024m -Xms 1024m ...) but we use half of it (roughly) to cache data from the DB... I already read in the forum Tomcat don't manage the memory, it is the JVM... so why the jvm use so many processes ? Also you could have many threads if you're using ajp13 connectivity since there is one thread by connection with server. Those are _not_ processes, they are threads... Use a decent operating system that supports them nicely (not Linux) and you'll see the difference (how many times do I have to repeat this?)... Linux sucks :-( On Linux threads are +/- process and are really cheap to create, so it's should be a problem. And if you have problem handling load with one Linux boxes, just use more Linux boxes and use jk load-balancing to spray the load. I never find Linux to suck, it's really depend on which architecture it run, and what you want to do with it. You could quickly start a small tomcat handling 50 concurrents users on recent ia32 boxes, multiply the number of boxes when the load increase, and use software load-balancing/fault-tolerance features of JK to make the tomcat/linux farm works well better than high-end (and pricy Unix workstations). With a very good performance/buck ratio ;) -- To unsubscribe, e-mail: mailto:tomcat-dev-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:tomcat-dev-help;jakarta.apache.org
Re: TOMCAT memory usage : how to manage and benchmark ?
On Linux threads are +/- process and are really cheap to create, so it's should be a problem. Read, it shouldn't be a problem -- To unsubscribe, e-mail: mailto:tomcat-dev-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:tomcat-dev-help;jakarta.apache.org
Re: TOMCAT memory usage : how to manage and benchmark ?
Henri Gomez [EMAIL PROTECTED] wrote: On Linux threads are +/- process and are really cheap to create, so it's should be a problem. Read, it shouldn't be a problem It is a problem because every time someone does a PS goes _nuts_ about the number of JVM processes... While at the end they are just threads... I believe I replied to this question at least 200 times in the past 5 years, and _still_ I see people asking... And try to do a little piece of code creating 1000 threads on Linux and on Windows 2k... Just to see which one is faster (and I believe we _all_ agree that Windows sucks!) :-) Anyhow, the old battle on why Linux sucks is over... Works for you, well, use it! :-) Pier (MacOS/X rocks!) -- To unsubscribe, e-mail: mailto:tomcat-dev-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:tomcat-dev-help;jakarta.apache.org
Re: TOMCAT memory usage : how to manage and benchmark ?
Pier Fumagalli wrote: Henri Gomez [EMAIL PROTECTED] wrote: On Linux threads are +/- process and are really cheap to create, so it's should be a problem. Read, it shouldn't be a problem It is a problem because every time someone does a PS goes _nuts_ about the number of JVM processes... While at the end they are just threads... I believe I replied to this question at least 200 times in the past 5 years, and _still_ I see people asking... Yes, I agree that seeing many entries with ps isn't correct but only Linux newbie have problem with it ;) And try to do a little piece of code creating 1000 threads on Linux and on Windows 2k... Just to see which one is faster (and I believe we _all_ agree that Windows sucks!) It's a known case, even without doing the test I know that W2K will be faster to create thread. There is excellent documentation on Linux kernel on IBM alphaworks site and they show cases where Linux or W2K implementations are better. :-) Anyhow, the old battle on why Linux sucks is over... Works for you, well, use it! :-) Thanks, it works great for me on ia32 boxes and even on iSeries LPAR (PPC) ;) Pier (MacOS/X rocks!) Pier you know I'm allready convinced that MacOS/X rocks ! The question is why Apple didn't help OpenSource developpers to switch their primary devel box from Linux ia32 to MacOS/X by making affordable hardware . -- To unsubscribe, e-mail: mailto:tomcat-dev-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:tomcat-dev-help;jakarta.apache.org
RE: TOMCAT memory usage : how to manage and benchmark ?
Pier (MacOS/X rocks!) -- Finally something I can agree with Pier on. :-) Jason -- To unsubscribe, e-mail: mailto:tomcat-dev-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:tomcat-dev-help;jakarta.apache.org
Re: Réf. : Re: TOMCAT memory usage : how to manage and benchmark ?
[EMAIL PROTECTED] wrote: G... Always the same problem! I tried in the tomcat.conf script : JAVACMD=$JAVA_HOME/bin/java -Xms128m -Xmx256m or in the dtomcat4 : JAVA_OPTS= -server -Xms128m -Xmx256m -- The memory used by my tomcat reach 300 MO or more with 0 user connected... Why ? It may be : - your application init stage - admin/manager (remove them if you don't need them) what is the goog hard config for 500 concurrent users on the same tomcat server ? It depend on your application, but I'll recommand a least 3 fast Intel based linux boxes, with about 512Mo of RAM, and in front an Apache 1.3/2.0 box + mod_jk. But it depend really on what your application is doing... -- To unsubscribe, e-mail: mailto:tomcat-dev-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:tomcat-dev-help;jakarta.apache.org
[OT]Re: TOMCAT memory usage : how to manage and benchmark ?
What operating system do you prefer, Pier? At 01:31 PM 10/28/2002 +, you wrote: [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: So, My first question is : why tomcat use all the memory while there is no users connected (or just one) ? The JVM allocates chunks of memory (see the -Xmx and -Xms flags by invoking java -X) and manages them... So, one user, 100 users, same thing... My second question is : how much memory is needed if I want to use tomcat with many users (500, 1000,...) ? On a 5 millions hits/day server (not running Tomcat, another servlet container since Tomcat doesn't work for us), we have the VM starting with 1 Gigs of RAM (java -server -Xmx 1024m -Xms 1024m ...) but we use half of it (roughly) to cache data from the DB... I already read in the forum Tomcat don't manage the memory, it is the JVM... so why the jvm use so many processes ? Those are _not_ processes, they are threads... Use a decent operating system that supports them nicely (not Linux) and you'll see the difference (how many times do I have to repeat this?)... Linux sucks :-( Pier -- To unsubscribe, e-mail: mailto:tomcat-dev-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:tomcat-dev-help;jakarta.apache.org Micael --- This electronic mail transmission and any accompanying documents contain information belonging to the sender which may be confidential and legally privileged. This information is intended only for the use of the individual or entity to whom this electronic mail transmission was sent as indicated above. If you are not the intended recipient, any disclosure, copying, distribution, or action taken in reliance on the contents of the information contained in this transmission is strictly prohibited. If you have received this transmission in error, please delete the message. Thank you -- To unsubscribe, e-mail: mailto:tomcat-dev-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:tomcat-dev-help;jakarta.apache.org
Re: [OT]Re: TOMCAT memory usage : how to manage and benchmark ?
micael [EMAIL PROTECTED] wrote: What operating system do you prefer, Pier? We use Solaris both for Intel and Sun platforms... First reason being is that we _know_ how that OS works, it's much more tuneable on live systems, and much easier to configure when you know what you're doing... Especially relating to Java, Solaris 8 was our platform of choice because of threading support. Linux threads behave like processes (you see them in ps for instance), that said it doesn't only have a visual disadvantage (that same output can be generated on Solaris with ps -AfL), but also a practical one... Limits and signals... First of all, threads-as-processes are vulnerable to signals, and therefore, given a bug in the VM (let's say a SEGV), what _can_ happen that only that process dies (instead of the whole JVM set of processes), I've seen that happening. Good point about that is that your Tomcat is going to be up, bad point about that is that it's going to really mess up the JVM internals (that's why Thread.kill() has been deprecated, and plus other random reasons). Short story, threads-as-processes are much weaker than threads-as-threads because of their behaviour towards the OS kernel... Second point about Solaris 8 is the _two_ different configurations of threads you can have... One is the default one, and works, but in some cases (fixed number of threads, usually pooled, yadayadayada) a nice thing such as LWP threads (used by pre-binding the /usr/lib/lwp/libthread.so in Java) can come _really_ handy and delivers a _lot_ more performances... (this helps a _lot_ also with Apache 2.0/worker). Third reason, limits... In case of highly loaded environments, the kernel will stop creating processes (and therefore threads under Linux) once the process limit is reached, threads-as-threads don't suffer from that because they are nested within their process scope, and the limit is _much_ higher. File descriptor limits, memory limits, swapping, and so on, come for free for us using Solaris, and it's _so_easy_ to tweak your network parameters on live systems by tweaking the kernel with NDD (file descriptors are in CLOSE_WAIT, no problem, set an NDD variable, and you're done)... Plus, what the heck, Solaris 8 minimal install is probably 20 packages and 100 Mb for both 32 and 64 bits, while if you install RedHat, you can never get below 400 Mb! :-) I love my disk space, and less code, less chances for a bug, right??? :-) It works for us, it has been working for ages, and we actually replaced all our old Linux/x86 installations with Solaris8/x86. That's production... For development, _of_course_ I use MacOS/X 10.2.2 which is by far the best desktop on the planet... I've had a short test with an X-Serve and load, performed allright (far better than a same-price Dell box), but it went nowhere because at the same time we inherited a lot more Sun Hardware for free (roughly! :-) so, we decided that we wanted to reuse all those nice UltraSparc machines! :-) Pier -- To unsubscribe, e-mail: mailto:tomcat-dev-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:tomcat-dev-help;jakarta.apache.org
Re: TOMCAT memory usage : how to manage and benchmark ?
On Tue, 2002-10-29 at 00:31, Pier Fumagalli wrote: Those are _not_ processes, they are threads... Use a decent operating system that supports them nicely (not Linux) and you'll see the difference (how many times do I have to repeat this?)... Linux sucks :-( Ha, ha... Keep dreaming Pier ;-) Bojan -- To unsubscribe, e-mail: mailto:tomcat-dev-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:tomcat-dev-help;jakarta.apache.org
Re: TOMCAT memory usage : how to manage and benchmark ?
On Tue, 2002-10-29 at 00:10, [EMAIL PROTECTED] wrote: Hello, I have tomcat 4.1.10 on a red hat Linux server 7.3 with the j2sdk141, When I start the tomcat4 service, all is OK and the tomcat server run. BUT, when I look the memory usage (with TOP utility), I have this result : 11:31am up 12 days, 2:18, 2 users, load average: 0,00, 0,00, 0,00 90 processes: 87 sleeping, 3 running, 0 zombie, 0 stopped CPU states: 0,0% user, 0,5% system, 0,0% nice, 99,4% idle Mem: 514340K av, 479748K used, 34592K free, 0K shrd, 75716K buff Swap: 1048120K av, 35016K used, 1013104K free 216648K cached PID USER PRI NI SIZE RSS SHARE STAT %CPU %MEM TIME COMMAND 19954 tomcat4 25 0 33584 32M 10464 S 0,0 6,5 0:05 java 19957 tomcat4 15 0 33584 32M 10464 S 0,0 6,5 0:00 java 19958 tomcat4 15 0 33584 32M 10464 S 0,0 6,5 0:00 java 19959 tomcat4 15 0 33584 32M 10464 S 0,0 6,5 0:00 java 19960 tomcat4 15 0 33584 32M 10464 S 0,0 6,5 0:00 java 19961 tomcat4 15 0 33584 32M 10464 R 0,0 6,5 0:00 java 19962 tomcat4 20 0 33584 32M 10464 S 0,0 6,5 0:00 java 19963 tomcat4 16 0 33584 32M 10464 S 0,0 6,5 0:00 java 19964 tomcat4 16 0 33584 32M 10464 S 0,0 6,5 0:01 java 19966 tomcat4 15 0 33584 32M 10464 S 0,0 6,5 0:00 java 19967 tomcat4 15 0 33584 32M 10464 S 0,0 6,5 0:00 java 19968 tomcat4 15 0 33584 32M 10464 S 0,0 6,5 0:00 java 19969 tomcat4 15 0 33584 32M 10464 S 0,0 6,5 0:00 java 19970 tomcat4 15 0 33584 32M 10464 S 0,0 6,5 0:00 java 19971 tomcat4 15 0 33584 32M 10464 S 0,0 6,5 0:00 java 19972 tomcat4 15 0 33584 32M 10464 S 0,0 6,5 0:00 java 19973 tomcat4 15 0 33584 32M 10464 S 0,0 6,5 0:00 java So, My first question is : why tomcat use all the memory while there is no users connected (or just one) ? Ah well, it's Java, that's why. There is a lot of side stuff going on in a JVM that requires heaps (no pun intended) memory (i.e. you have to pay for having strong runtime typing, no buffer overflows, run anywhere...). My second question is : how much memory is needed if I want to use tomcat with many users (500, 1000,...) ? Huh, depends on what your applications do, really. For so many concurrent users Tomcat will create separate threads, which means separate local storage for all of them. Then there is the garbage collection algorithm, which is usually lazy, so more then absolutely necessary will be allocated etc. I already read in the forum Tomcat don't manage the memory, it is the JVM... so why the jvm use so many processes ? This is configurable in server.xml, I think. However, if you under configure it, some clients may be left out. Bojan -- To unsubscribe, e-mail: mailto:tomcat-dev-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:tomcat-dev-help;jakarta.apache.org
Re: TOMCAT memory usage : how to manage and benchmark ?
On 28/10/02 22:40, Bojan Smojver [EMAIL PROTECTED] wrote: On Tue, 2002-10-29 at 00:31, Pier Fumagalli wrote: Those are _not_ processes, they are threads... Use a decent operating system that supports them nicely (not Linux) and you'll see the difference (how many times do I have to repeat this?)... Linux sucks :-( Ha, ha... Keep dreaming Pier ;-) Works for you? Good! Doesn't for me! :-) Pier -- To unsubscribe, e-mail: mailto:tomcat-dev-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:tomcat-dev-help;jakarta.apache.org
Re: TOMCAT memory usage : how to manage and benchmark ?
On Mon, 28 Oct 2002 [EMAIL PROTECTED] wrote: JAVA_OPTS= -server -Xms128m -Xmx256m -- The memory used by my tomcat reach 300 MO or more with 0 user connected... The memory usage of the process is not the total of the memory of all the threads. Take ONE thread memory usage (in top for example), this is the memory usage of your process. You can confirm this output with a call to Runtime.getRuntime().totalMemory(). -- Denis Benoit -- To unsubscribe, e-mail: mailto:tomcat-dev-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:tomcat-dev-help;jakarta.apache.org