Excessive memory reserved for caching on Linux - linux

How can I find out that it is causing excessive reserved of memory caching?
I only free space with:
free && sync && echo 3 > /proc/sys/vm/drop_caches && free
About of 10gb is reserved by caches. See list proccess before of run drop_caches:
Software version:
mysqld: 5.5.44-0ubuntu0.14.04.1
Linux: Ubuntu 14.04.3 LTS -> 3.13.0-37-generic #64-Ubuntu SMP Mon Sep 22 21:28:38 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
ClamAV: 0.98.7/23224/Tue Mar 21 08:29:04 2017
Apache: 2.4.7 (Ubuntu) Server built: Sep 23 2015 15:34:04

Related

lsyncd - OVERFLOW in event queue - Solution is to tune fs.inotify.max_queued_events

lsyncd is a fantastic alternative to NFS or NAS for replicating files among your Linux hosts. I have found the daemon works well with large Linux filesystems (many files, small to large sizes, xfs, ext4, luks) but requires some sysctl tuning as your filesystem grows.
This "question" is a note to myself so I can always find the answer via searching on stack overflow. Hope it helps you!
Github Project: https://github.com/axkibe/lsyncd
Exception in /var/log/lsyncd.log:
Thu Jun 18 17:48:52 2020 Normal: --- OVERFLOW in event queue ---
Thu Jun 18 17:48:52 2020 Normal: --- HUP signal, resetting ---
Thu Jun 18 17:48:52 2020 Normal: waiting for 1 more child processes.
Solution when you see "OVERFLOW in event queue" in lsyncd.log
From other knowledge bases, I had learned to tune max_user_watches, but by also tuning the max_queued_events, I corrected an OVERFLOW in event queue exception.
The temporary solution worked without needing to restart my lsyncd process.
I picked the number 1000000 as an arbitrarily large number. The default Ubuntu 18 value is 16384.
Temporary Solution
Check your current tuning values:
$ sysctl fs.inotify.max_queued_events
fs.inotify.max_queued_events = 16384
$ sysctl fs.inotify.max_user_watches
fs.inotify.max_user_watches = 8192
Update both max_user_watches and max_queued_events via shell
sudo sysctl fs.inotify.max_user_watches=1000000
sudo sysctl fs.inotify.max_queued_events=1000000
Permanent Solution, Persists after reboot
Update both max_user_watches and max_queued_events in /etc/sysctl.conf
fs.inotify.max_user_watches=1000000
fs.inotify.max_queued_events=1000000
Lsyncd.conf Basic Configuration
/etc/lsyncd/lsyncd.conf
settings {
logfile = "/var/log/lsyncd.log",
pidfile = "/var/run/lsyncd/lsyncd.pid",
insist = true
}
sync {
default.rsyncssh,
source="/var/application/data",
host="node2",
excludeFrom="/etc/lsyncd/exclude",
targetdir="/var/application/data",
rsync = {
archive = true,
compress = false,
whole_file = true
},
ssh = {
port = 22
}
}
System Details
Linux service1staging 5.0.0-36-generic #39~18.04.1-Ubuntu SMP Tue Nov 12 11:09:50 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
Ubuntu 18.04.4 LTS
lsyncd --version
Version: 2.1.6

Node.js Date does not consider DST (daylight saving time)

I'm living in Vancouver, west coast of North America, Canada. The original timezone here is PST (pacific standard time, UTC - 8h), but it's now PDT (pacific daylight time, UTC - 7h) since the daylight saving time has started.
The problem is that Node.js uses the original non-DST time, while Ubuntu returns DST.
In the following, both should be 21:44.
$ echo `date` , `node -e "console.log(new Date().toString())"`
Mon May 25 21:44:57 DST 2020 , Mon May 25 2020 20:44:57 GMT-0800 (GMT-08:00)
Why does this happen? How to let Node.js recognize DST?
I use Noce.js v12.16.3 on Ubuntu 18.04.4 as WSL on Windows 10. (Node.js v12.16.3 for Windows works correctly.) TZ env is not set.
UPDATE I don't want to install external libraries.
A more accurate library would be moment.js. You can set the time to recognize DST like this:
moment(timestamp).tz(timezone).isDST()
Here is an example:
moment(1451624400000).tz('America/New_York').isDST();
You can read more about recognized timestamps and timezones in the documentation on the website that I linked above.
My test shows that node does honor daylight saving time:
$ date; node -e "console.log(new Date().toString())";
Fri Jul 17 23:13:32 EDT 2020
Fri Jul 17 2020 23:13:32 GMT-0400 (Eastern Daylight Time)
$ date --date='Fri Jul 17 2020 23:13:32 GMT-0400'
Fri Jul 17 23:13:32 EDT 2020
$ node -v
v10.21.0
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 20.04 LTS
Release: 20.04
Codename: focal

JxBrower7.7 start timeOut error,Red Hat Enterprise Linux Server release 7.6 (Maipo)

linux:
[root#localhost bin]# cat /etc/redhat-release
Red Hat Enterprise Linux Server release 7.6 (Maipo)
[root#localhost bin]# cat /proc/version
Linux version 4.14.0-115.5.1.el7a.06.aarch64 (mockbuild#arm-buildhost1) (gcc version 4.8.5 20150623 (NeoKylin 4.8.5-36) (GCC)) #1 SMP Tue Jun 18 10:34:55 CST 2019
[root#localhost bin]# file /bin/bash
/bin/bash: ELF 64-bit LSB executable, ARM aarch64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 3.7.0, BuildID[sha1]=8a346ec01d611062313a5a4ed2b0201ecc9d9fa1, stripped
JxBrower7.7:
i used this demo,the line 55 is:Browser browser = engine.newBrowser();
enter code here
public static void main(String[] args) {
Engine engine = Engine.newInstance(
EngineOptions.newBuilder(OFF_SCREEN).build());
Browser browser = engine.newBrowser();
enter code here
[root#localhost bin]# java -jar test.jar
Exception in thread "main" com.teamdev.jxbrowser.navigation.TimeoutException: Failed to execute task withing 45 seconds.
at com.teamdev.jxbrowser.navigation.internal.NavigationImpl.loadAndWait(NavigationImpl.java:248)
at com.teamdev.jxbrowser.navigation.internal.NavigationImpl.loadUrlAndWait(NavigationImpl.java:105)
at com.teamdev.jxbrowser.navigation.internal.NavigationImpl.loadUrlAndWait(NavigationImpl.java:82)
at com.teamdev.jxbrowser.navigation.internal.NavigationImpl.loadUrlAndWait(NavigationImpl.java:74)
at com.teamdev.jxbrowser.engine.internal.EngineImpl.newBrowser(EngineImpl.java:458)
at com.pinnet.HelloWorld.main(HelloWorld.java:55)
linux logs at /var/logs/messages:
22 09:48:53 localhost dbus[8661]: [system] Activating via systemd: service name='org.bluez' unit='dbus-org.bluez.service'
May 22 09:48:54 localhost abrt-hook-ccpp: Process 90562 (chromium) of user 0 killed by SIGABRT - dumping core
May 22 09:48:54 localhost abrt-hook-ccpp: Process 90566 (chromium) of user 0 killed by SIGABRT - ignoring (repeated crash)
May 22 09:48:54 localhost abrt-hook-ccpp: Process 90561 (chromium) of user 0 killed by SIGABRT - ignoring (repeated crash)
May 22 09:48:54 localhost abrt-hook-ccpp: Process 90593 (chromium) of user 0 killed by SIGABRT - ignoring (repeated crash)
May 22 09:48:55 localhost abrt-hook-ccpp: Process 90624 (chromium) of user 0 killed by SIGABRT - ignoring (repeated crash)
May 22 09:48:55 localhost abrt-hook-ccpp: Process 90623 (chromium) of user 0 killed by SIGABRT - ignoring (repeated crash)
May 22 09:48:56 localhost abrt-server: Duplicate: core backtrace
May 22 09:48:56 localhost abrt-server: DUP_OF_DIR: /var/spool/abrt/ccpp-2020-05-21-16:55:06-33694
May 22 09:48:56 localhost abrt-server: Deleting problem directory ccpp-2020-05-22-09:48:54-90562 (dup of ccpp-2020-05-21-16:55:06-33694)
May 22 09:48:56 localhost abrt-server: /bin/sh: reporter-mailx: 未找到命令
May 22 09:49:18 localhost dbus[8661]: [system] Failed to activate service 'org.bluez': timed out

I want to know if my server was shutdown and time that is shutting down in

i have a server hp with ubuntu server
I want to know if my server was shutdown and time that is shutting down in
there are something to know a logs of my server
You can try the last reboot command to get some basic information about the most recent reboots and the uptime between them.
# last reboot
reboot system boot 2.6.32-431.3.1.e Fri Mar 14 07:02 - 01:51 (8+18:49)
reboot system boot 2.6.32-431.3.1.e Sun Feb 16 02:15 - 06:59 (26+03:44)
reboot system boot 2.6.32-431.3.1.e Sun Jan 26 16:21 - 06:59 (46+13:38)
reboot system boot 2.6.32-358.11.1. Sun Oct 13 18:53 - 16:18 (104+22:25)
reboot system boot 2.6.32-358.11.1. Sun Oct 6 10:10 - 18:50 (7+08:40)
reboot system boot 2.6.32-358.11.1. Sat Jun 29 09:28 - 10:06 (99+00:38)
reboot system boot 2.6.32-358.11.1. Sat Jun 29 09:06 - 09:25 (00:19)
reboot system boot 2.6.32-358.6.2.e Sat Jun 29 08:46 - 09:01 (00:15)

Cannot load mcrypt extension

phpMyAdmin reports Cannot load mcrypt extension. I'm running Centos 6.2 x86_64 with PHP 5.3.3 and Zend Engine v2.3.0.
This is what I've checked so far:
php.ini is in /usr/local/zend/etc/php.ini as reported by phpinfo();.
PHP version
[root#localhost etc]# php -v
PHP 5.3.3 (cli) (built: Jul 3 2012 16:53:21)
Copyright (c) 1997-2010 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies with Xdebug v2.1.4, Copyright (c) 2002-2012, by Derick Rethans
[root#localhost etc]#
Matching mcrypt and mbstring libraries installed:
[root#localhost etc]# rpm -qa | grep -P 'mcrypt|mbstring'
libmcrypt-devel-2.5.7-1.2.el6.rf.x86_64
php-5.3-mcrypt-zend-server-5.3.14-1.x86_64
php-5.3-mbstring-zend-server-5.3.14-1.x86_64
libmcrypt-2.5.7-1.2.el6.rf.x86_64
php-mbstring-5.3.3-14.el6_3.x86_64
[root#localhost etc]#
Log files are clean. I skipped the output of access_log because it is long and there is nothing of interest.
[root#localhost etc]# tail /var/log/messages
Jul 22 03:28:01 localhost kernel: imklog 4.6.2, log source = /proc/kmsg started.
Jul 22 03:28:01 localhost rsyslogd: [origin software="rsyslogd" swVersion="4.6.2" x- pid="1455" x-info="http://www.rsyslog.com"] (re)start
Jul 22 07:46:35 localhost yum[11527]: Installed: libmcrypt-2.5.7-1.2.el6.rf.x86_64
Jul 22 07:46:35 localhost yum[11527]: Installed: libmcrypt-devel-2.5.7-1.2.el6.rf.x86_64
Jul 22 07:58:00 localhost yum[11817]: Installed: php-mbstring-5.3.3-14.el6_3.x86_64
[root#localhost etc]#
[root#localhost etc]# tail -n 5 /var/log/httpd/error_log
[Sun Jul 22 08:37:19 2012] [notice] SELinux policy enabled; httpd running as context unconfined_u:system_r:httpd_t:s0
[Sun Jul 22 08:37:19 2012] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Sun Jul 22 08:37:19 2012] [notice] Digest: generating secret for digest authentication ...
[Sun Jul 22 08:37:19 2012] [notice] Digest: done
[Sun Jul 22 08:37:19 2012] [notice] Apache/2.2.15 (Unix) DAV/2 PHP/5.3.14 configured -- resuming normal operations
[root#localhost etc]#
The shared objects mcrypt.so and mbstring.so are in the extension_dir. I got extension_dir from php_info(); and then listed the directory contents. Both shared objects present.
I've done multiple restarts of httpd.
Disabling SELinux does not fix the problem.
Yeah, I know I'm running as root. It is on a local VM without external network access. My goal is to document and resolve this issue.
References
question-defense.com
StackOverflow "PhpMyAdmin install errors"
StackOverflow "Failed to proper setup php..."

Resources