Virtual memory always full / PhPmyadmin / Logs / admin context ( and other NOOB Q )

9 posts / 0 new
Last post
#1 Thu, 05/02/2019 - 22:44
krembo99

Virtual memory always full / PhPmyadmin / Logs / admin context ( and other NOOB Q )

Hello all. I just discovered and started testing virtualmin for a few days. I have some very NOOB general questions :

1 - Why is my virtual memory always on 100% ( or close. minimum I saw was 96% ) I have installed with the default install.sh script (centOs) , and have changed nothing yet. I have only one ( main domain) two users ( root + admin ) and one virtual server. All other settings are basically defaults. Default "authentic" theme. I have seen some threaads about needing to set virtual memory swaps but I am not sure if that is the case ( and if it is , why the install.sh does not take care of it ) or how to do so correctly .

2 - In the Default "authentic" theme, Administration Options -> Switch to server's admin.

How one can go back without logging out and re-login again?

Is there some way to switch dashboard context that I missed out?

I read an old issue thread in github ( https://github.com/authentic-theme/authentic-theme/issues/31) and still could not find how to switch back. ( the UX is a bit confusing I must admit )

3- In the dashboard recent logins , I can see a table like

xx.xxx.xx.xx 05/03/2019 11:35 AM This login
xx.xx.xx.xx 05/02/2019 4:50 PM Logged in

Is there a way to "kick" logins ( end sessions ) ?

4 - Regarding PhpMyadmin -

Do I have to install it ( or enable it ) for each one of the servers ( domains) in "Install Scripts" menu item?

The default install.sh does not install any instance of that ?

same question for roundcube BTW..

Sorry for the multiple question - and Thanks in advance for the replies. Virtualmin looks really great. I just hope I can master it quickly as the UI/UX needs a lot of patience.

Sat, 05/04/2019 - 09:11
andreychek

Howdy,

1. Why is my virtual memory always on 100%

You may need to review the processes running on your server to determine what is using up your available RAM.

One option is to disable unnecessary services, and/or increase your available RAM or setup swap. This here may help with disabling some services:

https://www.virtualmin.com/documentation/system/low-memory

2. How one can go back without logging out and re-login again?

Sorry, for security reasons, there isn't a way to switch back without re-logging in. Once you select the "Login as server owner" option, you fully become that actual user. If there were a way to switch back, it could introduce security problems where domain owners could elevate their permissions.

3. Is there a way to "kick" logins

Yup, Webmin -> Webmin -> Webmin Users -> View Login Sessions, then you can select "Disconnect" for any session.

4. Do I have to install it ( or enable it ) for each one of the servers ( domains) in "Install Scripts" menu item?

No domains or web apps are installed by default. Anytime you add a domain, if you want phpMyAdmin or RoundCube, you'd need to go into Install Scripts, and then install any web apps you want associated with that domain.

-Eric

Mon, 05/06/2019 - 09:01
krembo99

Thanks for the reply . Good points .

However, the first question I had still bothered me . I noticed that every time I reboot virtualmin, the virtual memory drops to zero again, and then steadily goes up to 99% again.. Never down. .. So I made a little experiment.

I have installed a new instance and logged in to see the results.

This is what I found :

As you can see, the virtual memory just goes up and up steadily - I did not post all imagees, but it is clear to which direction it is going .. After 42h the server hit 99% ...

Is that normal ?

I understand that this is a minimum server with very little RAM and small HD . ( it was just a test ) But - I had only one domain, no actual websites installed , no mail accounts, one single ftp account , and two users ( root + one admin ) . It also looks a bit strange to me that the virtual memory just climbs up - and never actually "swaps" as the name suggests .

The real memory (RAM) is steady at about 30% of the total 1GB. ( can see at the bottom of attached image )

Looking at the processes suggest that the fail2ban process is the biggest memory hog, but I can not understand why. The server like I said is new and clean, apache logs almost empty ( there are no websites ) actually almost each log I checked was clean.

( there was indeed some kiddie script trying to find some basic http based vulnerabilities - but it only had about 200 hits ( in 5 min ) and left.. - but that can hardly be the problem.)

A Temp ( and bad ) solution might be to schedule a reboot of virtualmin every day to clean the memory - at least until identifying the culprit .

So what can be other possibilities ? what other causes? I doubt it is normal behavior because virtualmin becomes inaccessible when it happens..

Thu, 05/09/2019 - 10:20
adamjedgar

Would be interested in your writeup of the troubleshooting for this. I have a sever doing this too. Mine is a 1 cpu 2 GB Ram VPS, and it takes about 3 days to shit itself. I know my problem is somewhere in apache but not sure where. An apache restart after even 2 days drops ram usage by 20%.

I thought about changing to nginx...my limited nginx experience and the htaccess issue scares me away from it though.

AJECreative is the home of $5 webhosting, $15/month VPS servers (1cpu,1gb RAM, 25GB storage)
Centos7, Debian9, or Ubuntu18LTS
Available Control Panels = Centos-Webpanel, Cyberpanel, or Virtualmin

https://ajecreative.com.au

Thu, 05/09/2019 - 13:01
scotwnw
  1. Your virtual mem is only 256mb. It should be the same or larger than your actual memory. At 36hrs, only 178mb virtual mem is used. Which is nothing. But the percent looks high because the max is lower than normal.
  2. Linux, no matter whats running, will tend to cache stuff in memory forever until something more important needs the memory space. So 30,40,50% memory use for an idle server is not unusual.
  3. Linux tends to cache things up to about 50% of the memory. So nothing to worry about Even 80% or more mem used is ok, which will actually still be 50% cache and 30% live use. Just increase your swap to 1x or 2x the memory. Then Just watch the swap, if its regularly 50% or higher, then start worrying about adding memory.
Thu, 05/09/2019 - 14:26 (Reply to #5)
krembo99

@scotwnw So you are saying it is normal to have a constant 99%-100% virtual memory ( after 42h circa ) in a case of an idle and virtualy empty server like this case ? I would have assumed that the virtuaal memory will somehow swap and will not be always so full ( especially because it renders virtualmin unavailable)

I will try to increase the memory and will see the results. ( BTW - what would be the best way of doing that on virtualmin ? ) As for now I had opened 3 different instances - all the same symptom. I will increase the Virtual memory and will leave them running to see .

Thu, 05/09/2019 - 15:08
scotwnw

Sorry, thought I was clear. No where did I say using all of virtual memory is normal or good. In my post I was specific about memory and virtual memory. Linux will use up to 50% of the MEMORY even on an idle system as it retains stuff in MEMORY as cache. With use, MEMORY will start getting fuller and will send stuff more regularly to VIRTUAL MEMORY if needed.(aka swap). High swap use is never good and will lead slow downs and eventually lock ups. But in your case, your total swap is set to low anyway so the gauge is not ideal. Set it to 1g and see what percent says then. Ideally you don't want it to use any VIRTUAL MEMORY at all. Virtual memory is strictly there to act as a buffer during spikes when system memory needs more space. If you're constantly filling up VIRTUAL MEMORY, then you need to add more physical MEMORY.

Thu, 05/09/2019 - 20:19
krembo99

Ok, thanks.

Indeed My question and issue was not about real MEMORY but about the VIRTUAL MEMORY.

There is no problem with the real MEMORY ( or RAM ) and it is steady ( with maybe 10-15mb difference ) throughout the process ( until Virtual memory is full ) This was exactly my question - why is the virtually memory (swap) gets filled with such normal memory use - and why it's not being "cleaned" after use... Theoretically from what I know, the VIRTUAL MEMORY should not even get used when there is a LOT of real MEMORY available. and even if it is used, it should be cleaned and swapped back at some point.

Anyhow, so that also means that the minimum requirements for virtualmin to actually work with default setup in regards to RAM would be at least 2GB ? Also, is there a way to increase the swap ( file or partition ) or VIRTUAL MEMORY "live" ( on an existing server ) in virtualmin ? I did not find any info on that. Should it be done manually only with swapon , swapfile , mkswap etc. ?

Fri, 05/10/2019 - 08:27
scotwnw

Adding swap is done via terminal or prior to creating the virtual server. Actually it can be done in webmin > Hardware.... > partitions and disks. IF you have a partition that's not in use. But you can not carve out space from a running partition. Can only add another swap partition if an empty partition already exists and i not in use. You can however add a swap file live with the commands you mentioned but the additional swap wont survive a reboot unless you also put the info in the /etc/fstab file.

Topic locked