Why App server memory is not being released even after completing the load test in silk performer? - jboss6.x

I am doing the load test of 150 users when we saw memory utilization of app server through vmstat command. it is showing that memory is not being released but after restart of App server it gets released. Even by monitoring through Dynatrace tool memory is getting releases but not showing on putty (vmstat).
App server : Jboss
Where is the problem?

Related

System CPU usage spikes when running chat application made in Express JS

I have developed a chat application using node JS, express JS, mongodb and socket io. Messages sent & received are stored in mongodb. But when I run the chat application the server CPU usage spikes continuously. See the attached screenshot:
It seems that something is stacking up. When I stop the chat application then the usage is resumed to minimum. What can be possible methods to fix this ?
There are a few potential methods you could use to debug this issue:
Use the node.js built-in debugger. You can set breakpoints in your code and then run your chat application under the debugger to see where the CPU usage is spikes are happening.
Use a profiler to take a look at what your chat application is doing when it's running. This can help you to identify which parts of the code are using up the most CPU time.
Use a performance monitoring tool to track the CPU usage of your chat application over time. This can help you to identify whether the issue is getting worse or if there are any patterns to the spikes in usage.
Try to reproduce the issue in a test environment and then use a debugging tool like strace or ltrace to see what system calls are being made when the CPU usage spikes. This can help you to identify what the chat application is doing that is causing the issue.
It's hard to answer your question without more information, but some sanity checks:
Make sure that you are not running too many processes on your server. If you are running multiple node.js applications on the same server, that can lead to high CPU usage. Try running each application on its own server, or limiting the number of processes that are running on each server.
Try using a different server environment. If you are using a shared hosting environment, the CPU usage may be spikes due to other users on the same server. Try using a dedicated server, or a virtual private server, which can help to reduce the CPU usage.

Is it normal that the memory consumed by nodejs keep increasing as the project size increase

I have a nodejs project that was running fine on my local machine using pm2 process manager. Now I migrated my code to a micro ec2 instance and when I started my server using pm2 it crashed. I checked memory consumption using free -m and I found that node almost consume 855 Mb of memory out of 1GB RAM. I refactored my code and I started from scratch and I found as I add more files and modules the memory used by node js increases. I changed the swappiness limit to 15 instead of 50. Another thing I tried to used my hard as a swap, Although it works but as I add more files and functionality to my project nodejs consume more memory. Is this behaviour normal. If not how to debug it. Finally are there any tweeks to links or nodejs infrastructure to minimize the memory footprint.
My server is not running any databases or anything. Only nodejs app.
Here is the value code meterics
And here is the free -m command

Node.js Active handles rise suddenly

I have a Parse Server which is a Node.js + express wrapper for a mobile app (about 100 simultaneous users every day), hosted on DigitalOcean. The app server communicates with MongoDB, which is hosted on another droplet of DigitalOcean. I'm using pm2 as a process manager and its monitoring tool, which is web-based. On the same process, we operate LiveQuery, a WebSocket server made by the Parse community as well.
The thing is, I've been having some performance issues with the server. Everything works smoothly, until the Active handles rise up uncontrollably! (see the image below) It's like after one point the server says "I'm done! Now I rest!"
Usually the active handles stay between 30 to 70. The moment I restart the process with pm2 restart everything goes back to normal!
I've been having this issue for quite some time now and I haven’t been able to figure out what’s causing it! Any help will be greatly appreciated!
EDIT: I did a stress test where I created 200 LiveQuery sockets for 1 user, instead of 2 that a user normally has and there was a spike of 300 active handles, for like 5 seconds! The moment the sockets were all created, everything went back to normal!
I usually use restart based on memory usage
pm2 start filename.js --max-memory-restart 160 --exp-backoff-restart-delay=100
pm2 has also built-in cron job or autostart script setup in case the server ever restarts, see https://pm2.keymetrics.io/docs/usage/restart-strategies/
it would be could if pm2 would provide restart options based on active connections or heap memory

How to prevent IIS from shutting down Web Site when not in use?

I have a web application hosted under IIS. It is a data warehouse, and during its startup process it requires instantiating a large set of items in memory (takes roughly ~20 minutes to fully set up). Because this website is critical to our company, this system must be online 100% during the daytime, and only can be restarted during off-work hours.
For some reason, this web application seems to be "offline" when there is no usage for some time. I know this because the cache is not fully instantiated when the website is visited. This is unacceptable.
It is not clear to me why the website is shut off. The application pool is only set to recycle daily at 4:00 AM (it is 11 AM now).
Are there other settings which I'm not aware of on the IIS part that causes it to shut down the website automatically?
Addl Note: The website does not shut off automatically when running in IISExpress in Visual Studio. Only the production version hosted on IIS shuts off.
Here's a screen of the Advanced Settings for the Application Pool the web site is running under. (Not sure if it's useful.)
I'm on IIS 7.5, Server 2008 R2. It is an ASP.NET 5 Web App.
Check Idle Time-out settings under process model in screenshot. That setting is causing app pool shutting down when remain idle for 20 mins. You can set it to 0 to keep it running all time even when its idle i.e. not processing any requests.
Note: Keeping app pool running all time will consume server's precious memory. It may become critical especially if application is leaking memory.

Profiling high CPU usage (with Nodetime) on my Node.js app running on Amazon ec2

I have been trying to do some load testing (using BlazeMeter) on my node.js app running on an amazon ec2. I started testing with 500 users hitting my endpoint on the t2.Micro but this soon collapsed (maxing both memory and CPU). I tried similar test on the t2.Small, t2.Medium and c3.large, with all of these tests, the memory was fine but I would end up maxing CPU and eventually response times would get above 60 seconds and I would get a 504 Gateway timeout from nginx.
I have tried profiling my app with Nodetime but nothing looks very strange:
It doesn't seem like any of the listed tasks is using much CPU but top tells me that the CPU (or CPUS running on c3.large) are totally maxed, and this leaves me a bit confused.
Am i reading this wrong?
EDIT:
Here is a screenshot of top showing node maxxing the CPU:
Try profiling for more time or on time when the CPU goes high.
Probably your profile time did not catch the peak CPU usage

Resources