• Home
  • Archive
  • Tools
  • Contact Us

The Customize Windows

Technology Journal

  • Cloud Computing
  • Computer
  • Digital Photography
  • Windows 7
  • Archive
  • Cloud Computing
  • Virtualization
  • Computer and Internet
  • Digital Photography
  • Android
  • Sysadmin
  • Electronics
  • Big Data
  • Virtualization
  • Downloads
  • Web Development
  • Apple
  • Android
Advertisement
You are here:Home » Sort Down Processes By Memory Usage on OpenVZ

By Abhishek Ghosh January 5, 2017 9:22 am Updated on January 5, 2017

Sort Down Processes By Memory Usage on OpenVZ

Advertisement

Analysis  of Memory Usage in OpenVZ Virtualization is Not Like Dedicated Servers. Here is How To Sort Down Processes By Memory Usage on OpenVZ. It is actually a difficult work to explore the low-level resources that were allocated while from inside the container. The reason behind this kind of search is 6GB RAM server at $7/month price. Previously, we discussed in details about the memory matters inOpenVZ vs KVM article.

Sort Down Processes By Memory Usage on OpenVZ

 

How To Sort Down Processes By Memory Usage on OpenVZ?

 

Normally on dedicated servers, we can check the GNU/Linux process memory usage with these commands :

Vim
1
2
3
4
top
free -m
ps aux --sort:rss
ps aux --sort -pid

If your OpenVZ instance is sucking 100% RAM when you can not explain the usage or data has mismatch (dashboard showing 100% usage but instance on SSH showing 40% usage), in such cases, you will see that the container is stable and processes are not generating Out of Memory (OOM) events. With 100% memory usage, it is not possible to expect a server to behave normally.

Advertisement

---

Itself the size reported by ps has little relation to actual memory usage. It is the virtual size of each process which isn’t necessarily allocated memory. It also doesn’t include some segments that are allocated.

You can run these two commands :

Vim
1
2
egrep 'dcachesize|resource' /proc/user_beancounters
cat /proc/meminfo | egrep 'MemTotal|MemFree|Slab|SReclaimable'

smem is a tool that can give numerous reports on memory usage on Linux systems. Unlike the other tools, smem can report proportional set size (PSS), which is a more meaningful representation of the amount of memory used by libraries and applications in a virtual memory system :

Vim
1
2
3
4
smem -t
smem -tw
# not for server
smem  --pie=name

PHP programs like this :

Vim
1
https://code.google.com/archive/p/php-cpu-monitor/

can show the near real usage. There is also memrank tool which lists processes in the system sorted by decreasing PSS.

 

How To Decrease Memory Usage on OpenVZ?

 

Memory accounted in Slab and in SReclaimable is considered as cached but will be freed upon request. Webservers like nginx, apache2 can running inside of a container can create this situation. With normal OpenCZ host account you can not directly fix it, you need to run these commands on main machine :

Vim
1
2
3
4
# for setting to 256 Mb
vzctl set <CTID> --dcachesize 268435456:295279001 --save
# when memory management schema is SLM
vzctl set <CTID> --save --slmmode ubc

Documentations are here :

Vim
1
2
3
https://openvz.org/Resource_shortage
https://wiki.openvz.org/UBC_auxiliary_parameters#physpages
https://wiki.openvz.org/User_Guide/Managing_Resources

As normally you’ll not get that chance, you can use /etc/security/limits.conf file and change the default size or better do a tweak with ulimit. As example, processes launched from Apache can be altered from /etc/init.d/apache2 script by 512Mb by adding :

Vim
1
ulimit -s 512

As lighttpd or nginx are multithreaded, so big stack per thread problem will remain. If you decrease the stack size any solution will have lower memory requirements.

Facebook Twitter Pinterest

Abhishek Ghosh

About Abhishek Ghosh

Abhishek Ghosh is a Businessman, Surgeon, Author and Blogger. You can keep touch with him on Twitter - @AbhishekCTRL.

Here’s what we’ve got for you which might like :

Articles Related to Sort Down Processes By Memory Usage on OpenVZ

  • Nginx WordPress Installation Guide (All Steps)

    This is a Full Nginx WordPress Installation Guide With All the Steps, Including Some Optimization and Setup Which is Compatible With WordPress DOT ORG Example Settings For Nginx.

  • Arduino and LED Bar Display : Circuit Diagram, Code

    Here is a Guide Explaining the Basics, Circuit Diagram, Code on Arduino and LED Bar Display. LED Bar Display is Actually Like Multiple LED.

  • WordPress & PHP : Different AdSense Units on Mobile Devices

    Here is How To Serve Different AdSense Units on Mobile Devices on WordPress With PHP. WordPress Has Function Which Can Be Used In Free Way.

  • OpenVZ vs KVM Virtualization : Which is Best for Cloud Server

    It is Quite Frequently Asked Which is Best Virtualization for Cloud Server. Here is OpenVZ vs KVM Virtualization Comparison from Usage POV.

performing a search on this website can help you. Also, we have YouTube Videos.

Take The Conversation Further ...

We'd love to know your thoughts on this article.
Meet the Author over on Twitter to join the conversation right now!

If you want to Advertise on our Article or want a Sponsored Article, you are invited to Contact us.

Contact Us

Subscribe To Our Free Newsletter

Get new posts by email:

Please Confirm the Subscription When Approval Email Will Arrive in Your Email Inbox as Second Step.

Search this website…

 

Popular Articles

Our Homepage is best place to find popular articles!

Here Are Some Good to Read Articles :

  • Cloud Computing Service Models
  • What is Cloud Computing?
  • Cloud Computing and Social Networks in Mobile Space
  • ARM Processor Architecture
  • What Camera Mode to Choose
  • Indispensable MySQL queries for custom fields in WordPress
  • Windows 7 Speech Recognition Scripting Related Tutorials

Social Networks

  • Pinterest (24.3K Followers)
  • Twitter (5.8k Followers)
  • Facebook (5.7k Followers)
  • LinkedIn (3.7k Followers)
  • YouTube (1.3k Followers)
  • GitHub (Repository)
  • GitHub (Gists)
Looking to publish sponsored article on our website?

Contact us

Recent Posts

  • Market Segmentation in BriefSeptember 20, 2023
  • What is Booting?September 18, 2023
  • What is ncurses?September 16, 2023
  • What is JTAG in Electronics?September 15, 2023
  • iPhone 15 Pro Max Vs Samsung Galaxy S22/S23 UltraSeptember 14, 2023
PC users can consult Corrine Chorney for Security.

Want to know more about us?

Read Notability and Mentions & Our Setup.

Copyright © 2023 - The Customize Windows | dESIGNed by The Customize Windows

Copyright  · Privacy Policy  · Advertising Policy  · Terms of Service  · Refund Policy