what is loginuid

4294967295 is just (unsigned long) -1. -1 means that loginuid was not set. This is normal behavior for processes that were not spawned by any login process (e.g. for daemons). loginuid is -1 by default; pam_loginuid module changes it to your user id whenever you login (in a tty/in DM/via ssh), and this value is preserved by child processes.

可惜的是proc.txt并未对此文件有过说明

用途:

追踪进程发起者

Spring Boot Reference Guide

http://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#boot-features-command-line-runner

 

http://docs.spring.io/spring-session/docs/current/reference/html5/

 

http://docs.spring.io/spring/docs/4.2.9.RELEASE/spring-framework-reference/htmlsingle/

 

https://spring.io/docs/reference

http://www.jianshu.com/p/3942cce05f71

 

http://www.mkyong.com/tutorials/spring-boot-tutorials/

redis 之 appendonly.aof

  1. redis.conf 中默认配置的dir为 “./” ,即为当前目录,一些人会想当然认为是redis.conf 所在目录,而appendonly.aof 默认写在该dir下; 其实,”./” 为进程的cwd
  2. redis的config set dir命令可以修改redis进程的cwd
  3. redis的appendonly.aof 的位置会参考在config appendonly yes 被执行时的dir的值,在config appendonly yes后修改dir的值不会立即生效

遇到过的问题:

  1. 程序一直在tail -f 的方式同步appendonly.aof ,在下午18:16的时候,appendonly.aof 变到了/tmp/appendonly.aof (原本下意识地认为/tmp/appendonly.aof 只是18:16之后的数据,行文至此,才意识到,/tmp/appendonly.aof中不是18:16后的数据,而是全部数据);目前确认进程没有被重启过,目前能够想到的能够完成这个切换的操作为:

    但是似乎没有谁会去执行这么复杂的命令

docker & cache

缘起:

dubbo-monitor容器swap使用率超过 20% ,而且在不断上升,为什么呢?

 

下面是容器dubbo-monitor在drop-caches前后的对比:

 

drop-cache后,容器的swap使用率没有变化

 

结论:

  1. docker stats 显示的内存使用是包含cache的
  2. 该容器的部分cache信息会被swap出内存
    1. cache和swap之间存在一些不默契;cache认为内存够多,还可以cache更多信息;swap机制为,经内存充裕,只要是不常被访问的内存数据,尽量swap出来; 于是乎,就形成了一个恶性循环,导致swap占用越来越大
    2. 解决办法: 定期drop一下cache
  3. 系统不会傻到把cache内容换出到swap中的,swap确实为进程使用的(虚拟)内存的一部分
  4. 一个允许最大使用2g内存的java进程,swap出来500m或1g不足为奇,如果给他的swap大小为2g的话,占用50%的swap都有可能

awk替换redis aof中db的方法

测试数据:

测试目标: 把 db 1 中的数据 导入到 db 10 里面去

awk脚本:

测试:

 

一般情况下,这样做事没问题的,特殊情况下会不好使(加入数据中包含极似协议的内容)

 

 

ngx.resp.get_headers()

 

syntax: headers = ngx.resp.get_headers(max_headers?, raw?)

context: set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, balancer_by_lua*

Returns a Lua table holding all the current response headers for the current request.

This function has the same signature as ngx.req.get_headers except getting response headers instead of request headers.

 

参考: https://github.com/openresty/lua-nginx-module#ngxrespget_headers

注意: 字段名都会转换成小写