I now have 8GB of ram in my server, so bare that in-mind when making recommendations on how much to up settings.
Basically, Apache won't concurrently load more than one page at a time. What the hell could be causing this? This causes real problems when I execute a page that takes a long time to load, no other pages will load.
Total idiot here, so advice desperately needed!
Thanks guys, must be something quite simple.
Problem solved, changed memory usage in scripts.
Related
I have a Rails 3.2 application running on production server. The server has 8 GB of RAM and every other process works fine. But, there is a ruby process which keeps the memory utilization on the higher side. I have to manually login to the server console and type the TOP command and kill the process using the PID.
But, I am unable to figure out how to check which ruby process is taking so much of memory and also how to control it permanently.
Please suggest me a solution.
Thanks.
Could be so many things. Finding memory leaks is tough. What kind of application server are you using? If you're using Unicorn consider checking out Puma. It's actually really easy to switch over. We saw big gains in our app when we switched to Puma.
Also look through your app for n+1 queries. Optimizing some queries here and there would help tremendously.
Another thing you could consider trying is moving some longer running tasks to a background job with something like sidekiq.
Lots of performance monitoring services out there, like New Relic, that you could check out as well. Without more info it's a tough question to answer.
I'm using PhantomJS via Python's webdriver lib. It eats lots of RAM and CPU, and it's an issue because I'd like to run as many instances as it's possible.
Some google'ing didn't give me anything helpful. So I'll ask directly:
Does the size matter? If I set driver.set_window_size(1280, 1024), will it eat more memory than 1024x768?
Is there any option in the source code which can be turned off without real issues and which lead to significant memory usage reduce? Yes I still need images and CSS and JS loading and applying, but I can get rid of some other features... For example, I can turn off caching (and load all media files every time). Yes, I do need to speed it up and make it less greedy and I'm ready to re-compile it... Any ideas here?
Thanks a lot!
I assume you call phantomjs once for every rendering job. This creates a new phantomjs process every time. You could try batching as many as you could in the one js script and call phantomjs once for the whole batch.
I've set up SOLR indices on my computer, and everything works fine.
I'm not experienced with SOLR but after profiling the "start.jar" process for a while, I've noticed that the RAM consumption jumps around a lot, anywhere from 150MB to 400MBish. And this is just for 10K documents!
So as a response, I wrote a script that just waits for SOLR to go past my RAM consumption limit (on shared hosting), and when it does, it kills start.jar and restarts it.
Does this have any adverse effect? And if so, what better solutions are there, besides get more RAM or use cloud based SOLR (which also costs money)? Sorry if this sounds stupid but I just need a working solution.
Thank you.
You need to provide some Index stats:
How big is your index (no. of docs & size in MB/GB)?
How many fields indexed/stored?
How much memory is allocated to JVM?
Do you optimize/commit, very often/realtime?
What is the SOLR Query time you see in logs?
Best
I noticed the other day that it seems like all the w3wp.exe running on my server are consuming way more RAM than I would expect. So I created test web application with a single aspx page and then a vanilla global.asax page as well (default methods, no additional code). I then deployed that site to IIS6 with a target framework of 4.0 built in release mode with debug set to "false". The site is also set up under it's own application pool. I then used issapp.vbs to figure out which w3wp.exe this test site was running under. I was surprised to see that the single site with 1 page was using almost 40mb of ram.
40mb of RAM seems like a lot for a single page website. Is this normal and if so why? Is there anything I can do to reduce the memory footprint?
I also noticed that each time the default page was refreshed that the w3wp.exe grew a little bit more. Is IIS6 caching the same page over and over?
40Mb for a single AppDomain (irrespective of how many pages you have) is alright. Consider that .NET is a managed environment and the app pool contains a large majority of the logic and heap for serving requests. In many cases it also will be less eager to free up RAM, if the RAM is not under contention (demanded by other parts of the system).
You can share app pools amongst different websites, and the "overhead" of the sandbox becomes less proportionate to your perception of what is acceptable. However, I don't think this is bad at all.
You're trying to optimize the case where you have no load and no clients. That really isn't sensible. Optimize for a realistic use case.
You don't build a factory and then try to get it to make one item as efficiently as possible. You try to get it to crank them out efficiently by the dozens.
This is not really an issue, since it is quite normal. Your .NET Framework is getting loaded and hence the size. When a real issue happens, you would have to use certain post production or profiling tools to get it fixed. Sharing some articles for memory and post production debugging just in case you need it in future.
http://msdn.microsoft.com/en-us/magazine/cc188781.aspx
http://aspalliance.com/1350_Post_Production_Debugging_for_ASPNET_Applications__Part_1.all
http://blogs.msdn.com/b/tess/archive/2006/09/06/net-memory-usage-a-restaurant-analogy.aspx
http://blogs.msdn.com/b/tess/archive/2008/09/12/asp-net-memory-issues-high-memory-usage-with-ajaxpro.aspx
Recently I've been writing a bot for a game which uses a DirectX backend for its rendering. I have managed to 'hack' the game into allowing me to run multiple instances. Unfortunately, this has taken a serious toll on my computer's CPU/RAM usage. I would like to optimize & reduce the amount of resources each instance eats up. Thus, I have a couple of questions:
If I stop DirectX from rendering, will this increase performance?
How can I do so?
I have a few ideas about how to do this - I'm guessing I can just hook the rendering function and force it to return without doing anything. My question though - will doing so noticeably improve performance?
Any help would be greatly appreciated.
First thing: No, immediately returning from the render call will not reduce CPU load, because you're then busy-waiting. You have to manipulate your main loop such that it does a wait for input or for a small timeout each time. That gives time to the other instances. In a first attempt, you could just pack a Sleep(some small amount) in there. Of course, that reduces the FPS of each instance, but it will allow other applications to run more smoothly.
And secondly: No, if you reduce the frame rate, the RAM usage will not be less. To reduce the memory load, you'll need to find more sophisticated ways, like removing textures when you don't need them any more etc.