LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat
User Name
Password
Red Hat This forum is for the discussion of Red Hat Linux.

Notices


Reply
  Search this Thread
Old 07-14-2016, 10:01 AM   #16
chris_carr
Member
 
Registered: Oct 2011
Location: Houston Tx
Distribution: RHEL 6
Posts: 57

Original Poster
Rep: Reputation: 0

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.
 
Old 07-14-2016, 10:06 AM   #17
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,729

Rep: Reputation: 5919Reputation: 5919Reputation: 5919Reputation: 5919Reputation: 5919Reputation: 5919Reputation: 5919Reputation: 5919Reputation: 5919Reputation: 5919Reputation: 5919
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.

Last edited by michaelk; 07-14-2016 at 10:08 AM.
 
Old 07-14-2016, 01:21 PM   #18
chris_carr
Member
 
Registered: Oct 2011
Location: Houston Tx
Distribution: RHEL 6
Posts: 57

Original Poster
Rep: Reputation: 0
Its a progress database. Most have no clue what that is.
 
Old 07-14-2016, 01:40 PM   #19
chris_carr
Member
 
Registered: Oct 2011
Location: Houston Tx
Distribution: RHEL 6
Posts: 57

Original Poster
Rep: Reputation: 0
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.
 
Old 07-14-2016, 02:40 PM   #20
jefro
Moderator
 
Registered: Mar 2008
Posts: 21,993

Rep: Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628
I didn't see second page.

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.

Last edited by jefro; 07-14-2016 at 03:31 PM.
 
Old 07-14-2016, 02:55 PM   #21
chris_carr
Member
 
Registered: Oct 2011
Location: Houston Tx
Distribution: RHEL 6
Posts: 57

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by jefro View Post
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.
 
Old 07-14-2016, 03:03 PM   #22
Emerson
LQ Sage
 
Registered: Nov 2004
Location: Saint Amant, Acadiana
Distribution: Gentoo ~amd64
Posts: 7,661

Rep: Reputation: Disabled
You could create several swap files if you do not want to create one large file.
 
Old 07-14-2016, 03:15 PM   #23
onebuck
Moderator
 
Registered: Jan 2005
Location: Central Florida 20 minutes from Disney World
Distribution: SlackwareŽ
Posts: 13,925
Blog Entries: 44

Rep: Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159
Member response

Hi,

Good wiki entry;
Quote:
From https://wiki.archlinux.org/index.php/Swap#Swap_file
Swap file

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
Hope this helps.
Have fun & enjoy!
 
Old 07-14-2016, 03:24 PM   #24
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,729

Rep: Reputation: 5919Reputation: 5919Reputation: 5919Reputation: 5919Reputation: 5919Reputation: 5919Reputation: 5919Reputation: 5919Reputation: 5919Reputation: 5919Reputation: 5919
Thanks onebuck for the posting the additional information...
 
Old 07-14-2016, 06:46 PM   #25
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,131

Rep: Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121
Quote:
Originally Posted by chris_carr View Post
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.
 
Old 07-14-2016, 08:09 PM   #26
jamison20000e
Senior Member
 
Registered: Nov 2005
Location: ...uncanny valley... infinity\1975; (randomly born:) Milwaukee, WI, US( + travel,) Earth&Mars (I wish,) END BORDER$!◣◢┌∩┐ Fe26-E,e...
Distribution: any GPL that work on freest-HW; has been KDE, CLI, Novena-SBC but open.. http://goo.gl/NqgqJx &c ;-)
Posts: 4,888
Blog Entries: 2

Rep: Reputation: 1567Reputation: 1567Reputation: 1567Reputation: 1567Reputation: 1567Reputation: 1567Reputation: 1567Reputation: 1567Reputation: 1567Reputation: 1567Reputation: 1567
I have shrunk / or /home and then increased /dev/sda2ieSwap from a live run many times with no problems.

It was good to see Onebuck's post as I've been using Btrfs for a while now... Thanks.
 
Old 07-18-2016, 06:46 AM   #27
enorbet
Senior Member
 
Registered: Jun 2003
Location: Virginia
Distribution: Slackware = Main OpSys
Posts: 4,784

Rep: Reputation: 4435Reputation: 4435Reputation: 4435Reputation: 4435Reputation: 4435Reputation: 4435Reputation: 4435Reputation: 4435Reputation: 4435Reputation: 4435Reputation: 4435
Quote:
Originally Posted by chris_carr View Post
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.

Last edited by enorbet; 07-18-2016 at 06:48 AM.
 
Old 07-20-2016, 08:54 AM   #28
chris_carr
Member
 
Registered: Oct 2011
Location: Houston Tx
Distribution: RHEL 6
Posts: 57

Original Poster
Rep: Reputation: 0
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.
 
Old 07-20-2016, 03:52 PM   #29
enorbet
Senior Member
 
Registered: Jun 2003
Location: Virginia
Distribution: Slackware = Main OpSys
Posts: 4,784

Rep: Reputation: 4435Reputation: 4435Reputation: 4435Reputation: 4435Reputation: 4435Reputation: 4435Reputation: 4435Reputation: 4435Reputation: 4435Reputation: 4435Reputation: 4435
@ 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.
 
Old 07-21-2016, 07:18 AM   #30
chris_carr
Member
 
Registered: Oct 2011
Location: Houston Tx
Distribution: RHEL 6
Posts: 57

Original Poster
Rep: Reputation: 0
@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.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
increasing swap wiliamvw SUSE / openSUSE 2 09-04-2013 06:25 PM
About increasing Swap Size shipon_97 Linux - Newbie 2 05-29-2007 12:45 PM
Need Help Increasing Swap by creating a swap file froggo Red Hat 3 06-13-2006 08:04 AM
Increasing swap space rupesh_pulikool Linux - Networking 1 09-12-2004 10:40 PM
Increasing swap partition suneet123 Linux - Software 3 12-16-2002 03:11 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat

All times are GMT -5. The time now is 04:59 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration