Red HatThis forum is for the discussion of Red Hat Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
and my DBA just walked in with his head down telling me he found out why it was eating all of our memory.
Turns out he had the database was set to pull 80% of the RAM on startup, but it is actually only consuming 15% of the system RAM. He is going to change the parameters on the database startup to only use a small portion of memory which should clear up these issues. If you guys are interested I will post again after the change so you can see the difference.
I still however want to increase my swap partition to reflect at minimum the amount of physical RAM in the system. Having an 8 gig swap partition just goes against everything I was ever taught about system builds, and my OCD is not going to allow me to keep it that way.
What database are you running? It may need some tuning. Depending on the size it could be a RAM issue. I see this issue could be resolved...
The 2x rule really is no longer valid. Depends on the system and what applications are running. With 2.6+ kernels a swap file is just as good as a swap partition.
ok I did not know the updated Kernels handled swap differently. better safe than sorry I guess. That makes me feel better. I did not want to have to tell my boss I need to rebuild his production machine.
Swap files are almost exactly the same as a swap partition. There may be a slight (technical) slower access.
It never hurts usually to fall back to the old standby rules for swap. 32G memory should have let you create at least 2-5 times that on a drive(s. While I agree that the rules don't fully work and still should be based on use.
Swap files are almost exactly the same as a swap partition. There may be a slight (technical) slower access.
It never hurts usually to fall back to the old standby rules for swap. 32G memory should have let you create at least 2-5 times that on a drive(s)
yes I think I'm going to attempt extending the swap partition tonight on a junk box. we will see how that goes. although it may be ok to use a swap file, I'm not just not willing to do that unless its the only option. Just makes me nervous.
As an alternative to creating an entire partition, a swap file offers the ability to vary its size on-the-fly, and is more easily removed altogether. This may be especially desirable if disk space is at a premium (e.g. a modestly-sized SSD). Warning: Btrfs does not support swap files. Failure to heed this warning may result in file system corruption. While a swap file may be used on Btrfs when mounted through a loop device, this will result in severely degraded swap performance. Swap file creation
As root use fallocate to create a swap file the size of your choosing (M = Megabytes, G = Gigabytes). For example, creating a 512 MB swap file:
# fallocate -l 512M /swapfile Note: fallocate may cause problems with some file systems such as F2FS or XFS.[1] As an alternative, using dd is more reliable, but slower: # dd if=/dev/zero of=/swapfile bs=1M count=512
Set the right permissions (a world-readable swap file is a huge local vulnerability)
# chmod 600 /swapfile After creating the correctly sized file, format it to swap:
# mkswap /swapfile Activate the swap file:
# swapon /swapfile Finally, edit fstab to add an entry for the swap file:
/etc/fstab /swapfile none swap defaults 0 0
yes I think I'm going to attempt extending the swap partition tonight on a junk box.
Swap is not a filesystem in the technical sense - you can't extend it. You can delete and reallocate larger, but when you mkswap on the new extent, the UUID changes - check your fstab.
Adding new space (partition/lv, even file) is much safer - if you screw up the new one, the old is still there working. KISS is usually best on a prod box.
Yes but this is a corporate server and you don't just add RAM, and adding RAM does not fix the bad SWAP partition.
Can you explain please? It is my understanding that given enough RAM there is NO need for swap at all. Aside from the theory of operation (it is not an across-the-board imperative to have more swap than RAM) I know this from experience in systems that have only hundreds of MBs of swap that is never utilized more than ~3% under extreme conditions.
If this is to be a successful corporate server, especially one used by 20 countries, I would think an investment in RAM to be a wise choice and not worth any delay. RAM can be hundreds, if not thousands, of times faster than shuffling off to hard drive when one runs out of RAM. So why run out? If the conditions of your software require such massive amounts of RAM (it does or you would not run out although 32GB isn't exactly massive by server standards) it implies either improving the software or increasing the RAM, not ever increasing swap size and introducing bottlenecks that will drive subscribers away. So why the resistance against adding useful and important RAM?
Incidentally, I do agree with the method of adding a new swap partition instead of resizing one, assuming there is no way to increase RAM or make the software more efficient.
I'm just a sys admin here brother. I do not have the purchasing power to add RAM, and I'm not the DBA, or on the development team so I'm not able to tweak the database or any other proprietary application for that matter. As I have stated before I did not build these systems, I just have the luck of being able to maintain them. I have gotten more than enough information on this thread on how to proceed. Thank you all for you input and opinions. I'm marking this as solved.
@ chris carr - I fully understand and relate to not always being in a position of power but you do have the power of knowledge. It can be shown that as cheap as RAM is these days... Shoot! even if the motherboard is so poorly suited to sever needs as to require replacement in order to accept more RAM, slow time, let alone downtime!, will exceed the cost of doubling or even quadrupling RAM in far less than a day. The person who makes such knowledge known by those in power will gain at the very least, respect. The only possible downside is some overly jealous person in chain-of-command so you would need to decide where or to whom this knowledge is shared.
@enorbet Yesterday I called a meeting with my manager and explained my concerns with the system. Citing that doubling the RAM on this box would be a form of "preventive maintenance". I explained that although we do not currently have an issue on the production machine, but doing nothing will surly cause issues in the future, especially once we get all 20 countries on the system. We are putting in quotes now for adding more RAM, which should be approved by next week. Thank you all again for all of your wisdom and help. It is truly appreciated.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.