Hot answers tagged

26

Try this: ps axo pid,ppid,rss,vsz,nlwp,cmd Output columns: pid - Process ID ppid - Parent Process ID rss - Resident Set Size - physical memory vsz - Virtual Set Size - virtual memory nlwp - Number of Light Weight Processes - thread count cmd - Command


20

Thus far, these have been my top considerations when determining Threads vs Processes : Threads will use up much less resident memory than Processes. Yes, with dynamically linked libraries a lot of memory is shared between the Apache Control Process and it's child Processes, however each new Process will need to instantiate all of the modules you have ...


7

Set the lowest number of vCPUs your servers need to perform their function, don't over-allocate them or you could easily slow down your VMs.


6

It compiles PHP with thread safety on. PHP doesn't have threads, but this is supposed to allow PHP to run in a threaded environment such as Apache's worker MPM. However, note that PHP thread safety is highly disputed. For more information on the topic, I will shamefully plug my answer to a related question.


5

David, let's first tackle your direct question: How to restrict Windows Vista to one core. I see two ways: (a) Run your Vista in a virtual machine on Hyper-V, and give the VM only one logical processor. This leaves you the rest of the machine to put to good use. (b) Alternatively, you can use the /numproc=1 option in boot.ini to force the machine to use ...


5

You can have 1,000 concurrent requests per second, depending on what is being requested. If it's an image file, it's easy to serve it quickly without huge resources, but if you are looking at 1,000 concurrent requests to a PHP script connecting to a MySQL backend, then we're going to have to start talking about a RAID setup, lots of RAM, seperate web and db ...


5

From StackOverflow: Linux doesn't have a separate threads per process limit, just a limit on the total number of processes on the system (threads are essentially just processes with a shared address space on Linux) which you can view like this: cat /proc/sys/kernel/threads-max The default is the number of memory pages/4. You can increase this like: ...


5

MySQL should use as much as free memory you have. The number of threads at this scale is very small and it doesn't affect the memory usage. The threads are sharing the same virtual memory space. They use only a few KB for thread metadata. The memory usage on the new MySQL is actually smaller than before. It has allocated in the virtual memory space 1.1GB, ...


4

Typically, HT works well on workloads that are heavier on IO -- the CPU can schedule in more processing tasks from the queue of the other virtual CPU while the first virtual CPU waits on the IO. Really all the HT subsystems get you is hardware-accelerated context switching -- which is the workload pattern that's also used when switching between VMs. So, HT ...


4

If you have only very few or none idle workers it means Apache is using all the processes it is allowed to use and new incoming requests have to wait for older requests to finish before they can be handled. In this case, increasing the maximum allowed processes in your configuration file might help with performance under certain circumstances. This is ...


3

The PHP FAQ explicitely states this is a bad idea. Most libraries it depends on are indeed no thread safe. If you wish to use Apache worker (I sure do, personally), you might want to investigate running the worker-mpm and PHP5 with FastCGI (mod_fcgid) instead. The "cgi" part might put you off, but rest assured, mod_fcgid results in great performance, it ...


3

Well, let's look at some bigger picture issues before getting into JRun configuration details. If you're getting java.lang.OutOfMemoryError exceptions in the JRun error log, well, you're out of memory. No upvote for that, please ;-). You didn't say whether you were running 32- or 64-bit Windows, but you did say that you have 8 GB of RAM, so that will have ...


3

This is rather tricky. Depending on the loads, HT can increase performance by ~30% or decrease it. Normally I advise not to allocate more vCPUs than you have physical cores, to a single VM, but if the VM is rather idle (and of course, such a VM will not really require too many CPUs), it can be given up to as many vCPUs as you have threads. You don't really ...


3

I'd look into SystemTap. This tool will certainly give you what you want. There is this example of profiling threads; don't know if it has all you want, but you could modify it so that it does.


3

Percent of cpu usage per thread you can get with ps command: ps -emo %cpu,pid,user,args The way it is calculated is described in ps manpage: Currently, it is the CPU time used divided by the time the process has been running (cputime/realtime ratio), expressed as a percentage.


3

What you're looking for is how to set the 'process affinity', and how you set it depends on what program you are starting, and how you are starting it up. I saw this answer on stack overflow: stackoverflow.com/questions/827754/....


3

There is no safe way to forcefully stop a Thread in Java. Please see Why Are Thread.stop, Thread.suspend, Thread.resume and Runtime.runFinalizersOnExit Deprecated? for more details. The correct solution would be to for the application to set socket timeouts and/or stop its threads properly.


2

While your configuration settings have room for improvement, such as what Embreau mentioned, they may not be the direct cause. It's potentially your application or something along the stack causing the issue. For example, if your application was waiting for a response from a database it could eventually cause all threads to be waiting thus causing issues ...


2

Your Timeout value is set to 300 seconds, which is 5 minutes, set it to a more reasonable value like 15 or 30 seconds. Now your problem might be with the ThreadsPerChild value. Set it to at least 250. Please monitor the change in task manager under load to be sure it is not overkill (it probably isn't, I've set it higher on some old single core CPU serving ...


2

Grant the CAP_SYS_NICE capability.


2

I think to elaborate on Chopper3's answer: if the systems are mostly cpu-idle, don't assign a bunch of vcpu, if they are cpu-intense, be very careful to not overallocate. You should be able to allocate a total of 8 vCPU without contention. You can overallocate, but if you do, make sure no single guest, especially a CPU-intensive guest, has 8 vcpu, or you ...


2

The version of pthreads is closely related to the version of glibc on the system, and updating glibc on CentOS is infeasible. You may be able to rebuild a pthreads from a newer version of glibc, but I cannot recommend this.


2

I'm using JBoss EAP 4.3 on dual-processor/dual-core and dual-processor/quad-core Dell PowerEdge servers. When we load-test the JBoss application, all the cores are in use (at varying levels) simultaneously. The bulk of the work is being done by the application, as our database usage is mostly write-only. Also, as Ronald indicated, it is always best to find ...


2

It should be multi threaded, you should be able to see mentions of thread counts in the logs (well, I know websphere and ATG Dynamo better, but much the same). Not that you cannot screw it up with a bad configuration. Read up on performance monitoring for your OS.


2

You have defined the http worker threads. Tomcat also needs some more like timer, ajp, jmx etc. You can control your existing threads for example with JVisualVM, bundeled with Oracles JVM.


2

An App Pool can contain multiple IIS Applications. An IIS application is a set of related pages that shares the same state - Application and Session variables are shared, for example. You app-ify or de-app-ify through the UI. An IIS Application may have zero or more AppDomains. An AppDomain is like a lightweight process-within-a-process, but it's a .Net-...


2

Yes, mpm prefork is always single-threaded. But this does not force all apache modules to be single-threaded because this just can't be forced.


2

You don't need to create more than 600 threads at a time. You only need threads for things you can usefully do at the same time. Your system cannot usefully do more than 600 things at a time. You do not need more threads to do more work. In any event, you're setting the wrong stack size. You're setting the limiting size of the initial thread stack, the one ...


2

Depending on what Apache is doing, lots of simultaneous requests to Apache could cause this. For example a big gnarly CMS might open a MySQL connection early on, take a long time to generate a page, and not close the connection till it's finished. FWIW, I've found that periodic polling of the current connections doesn't usually show the real picture. You ...


2

8 threads would be ideal, assuming there's no significant additional overhead in result combining or anything like that. With only four threads, any execution units that couldn't be saturated by the single thread per virtual core would be wasted. With eight threads, they can be used. Note that this only applies to the unrealistic assumption that each thread ...



Only top voted, non community-wiki answers of a minimum length are eligible