Tag Info

Hot answers tagged

19

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 ...


17

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


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.


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

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 ...


4

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.


4

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: ...


4

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, ...


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.


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

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

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

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 ...


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

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 ...


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

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

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

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

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 ...


2

You will have problem if: - you use transactions. Two threads starting transactions on the same connection would not be nice for your datas. Think about what mysql will do if one thread want a rollback - you use auto increment and LAST_INSERT_ID. If two threads work on the same table at the same moment, the last id is the same for both if they share the same ...


2

Sleeping MySQL processes do in fact use up CPU. 150 sleeping queries is a lot. Do you have hundreds (or more) of concurrent connections? If not, this is probably the first thing to look at. Within your web application, make sure you close the MySQL connection after you've finished your query. mysql_close() in PHP, but implementation is based on your ...


2

Grant the CAP_SYS_NICE capability.


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

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 ...


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

The Mongo DB Project recommends setting kern.threads.max_threads_per_proc=32000 kern.maxfilesperproc=64000 in /etc/sysctl.conf. You can run /etc/rc.d/sysctl restart to have the new setting take effect immediately, or reboot (whatever floats your boat)


2

You have to build performance tests for particular application in order to figure out the optimum sizes. Different strategies could be applied in your particular app to work with DBs: some of them release connections to DBs several times per request, others may not give it away during the whole request processing. In first case you can configure thread pool ...



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