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

This Article Has Been Shared 510 Times!

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

  • Setup own URL Shortening Service for Websites on Rackspace Cloud

    Setup own URL Shortening Service for Websites on Rackspace Cloud within fraction of a minute using Free Google Apps Labs Short Links service.

  • Cloud Computing Disaster Recovery For WordPress After Hacking

    Cloud Computing Disaster Recovery Cheat Sheet for WordPress presents the clever ways to make the hacker fool and get your website back within few minutes.

  • Misconceptions About Private Cloud

    Misconceptions About Private Cloud nevertheless still present on users’ side. Growth of private cloud computing is driven by the rapid spread of virtualization.

  • Will Cloud Computing Kill the Market of Hardware Manufacturers?

    Will Cloud Computing Kill the Market of Hardware Manufacturers ? Cloud computing is transforming IT from the users to providers, to large companies in some way.

  • Capabilities Required by the Professionals in the Era of Cloud Computing

    Capabilities required by the professionals in the era of Cloud Computing is not limited to IT sector but it includes the Health, Law and other professionals.

Additionally, 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 (22.1K 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

  • The Future Of Serverless: The Load-Intensive Workload Case May 25, 2022
  • Cutting Out The Coding: Serverless Computing In Action May 24, 2022
  • Types of Blackjack Variants: Discover the Different Versions of the Game May 23, 2022
  • How Cloud, Robotics And Sensor Technologies Are Changing The Business Landscape May 23, 2022
  • Modernizing Your Business With a Hybrid Cloud Strategy May 22, 2022

About This Article

Cite this article as: Abhishek Ghosh, "Sort Down Processes By Memory Usage on OpenVZ," in The Customize Windows, January 5, 2017, May 25, 2022, https://thecustomizewindows.com/2017/01/sort-down-processes-by-memory-usage-on-openvz/.

Source:The Customize Windows, JiMA.in

This website uses cookies. If you do not want to allow us to use cookies and/or non-personalized Ads, kindly clear browser cookies after closing this webpage.

Read Privacy Policy.

PC users can consult Corrine Chorney for Security.

Want to know more about us? Read Notability and Mentions & Our Setup.

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

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