包含标签 linux articles

linux下修改mtu值

一、jumbo frames 相关 1、什么是jumbo frames Jumbo frames 是指比标准Ethernet Frames长的frame,即比1518/1522 bit大的frames,Jumbo frame的大小是每个设备厂商规定的,不属于IEEE标准;Jumbo frame 在full-duplex 的Ethernet网络上运行;……

Continue reading

精确计算rss使用值

在 也看linux内存去哪儿了 篇,最后提到精确计算rss内存的方法,这里写了一个简单的脚本,通过pmap遍历每个进程。将所有结果遍历汇总到一个文件后,再将使用相同的l内存地址的去重,完了再求和。脚本如下: 1# cat rrs.sh 2#!/bin/bash 3filename=`cat /proc/sys/kernel/random/uuid` 4for PROC in `ls /proc/|grep "^[0-9]"` 5do 6pmap -xq $PROC|grep -v $PROC: >> /tmp/$filename 7done 8RRSvalue=`awk '{print $1,$3}' /tmp/$filename|awk '!a[$0]++'|awk 'BEGIN{sum=0}{sum+=$2}END{print sum}'` 9echo $RRSvalue"kB" 10rm -rf /tmp/$filename……

Continue reading

Linux slabtop显示内核片缓存信息

一、linux内核片缓存概念 Linux 所使用的 slab 分配器的基础是 Jeff Bonwick 为 SunOS 操作系统首次引入的一种算法。Jeff 的分配器是围绕对象缓存进行的。在内核中,会为有限的对象集(例如文件描述符和其他常见结构)分配大量内存。Jeff 发现对内核中普通对象进行初始化所需的时间超过了对其进行分配和释放所需的时……

Continue reading

redhat修复模式安装丢失的包及grub引导修复

一台即将上线的主机被工程侧的兄弟在补漏洞时把glibc包给删除了,重启后导致主机启动出错,同事打过来电话求破解方法。这里记录下常见的修复模式修复的方法以便科普。 一、模拟故障现象 以下步骤请慎在现网环境上操作,这里只是模拟现网中经常发生的情况。登陆linux系统之后,依次执行以下命令……

Continue reading

寻找IO杀手进程

linux下可以通过iostat查看目前主机总的io使用情况,不过当通过top等命令查看时,发现cpu wait占多过多,想定位具体是哪些程序占用了IO,本篇就通过一些常用的手段进行汇总下。 一、top下的wait状状 wa = I/O waiting ,wa指的是CPU等待磁盘写入完成的时间,就是说前提是要进……

Continue reading

linux配置静态路由

主机只有一块网卡的时候,不会涉及到默认路由和静态路由的问题。两块网卡时,也可以一块配置有网关(默认路由走这个网卡),另外一块只配置IP和掩码确认(该主机同网络的可以互通)。不过在稍大型的、有多网段的环境里就需单独进行默认路由和静态路由的配置了。 一、需求 目前有如下的一个网络,主机有……

Continue reading

三张图看遍Linux性能监控、测试、优化工具

Linux 平台上的性能工具有很多,眼花缭乱,长期的摸索和经验发现最好用的还是那些久经考验的、简单的小工具。系统性能专家 Brendan D. Gregg在最近的 LinuxCon NA 2014 大会上更新了他那个有名的关于 Linux 性能方面的 talk (Linux Performance Tools)和幻灯片。 和 Brendan 去年的 talk 比较,今年增加了测试和优化两部分。下面的三张图片分别总结了 Li……

Continue reading

service与chkconfig的替代者systemctl

linux中有很多命令已经存在了N多年,渐渐一些已被一些新命令所代替,不过由于习惯的原因,很多时候我们并不能一下子适应过来 ,例如ifconfig之于ip命令。最近在玩ubuntu和opensuse时发现了systemctl命令了,后来在试玩centos7时也发现了该命令,syst……

Continue reading

linux 让ssh只允许指定的用户登录

如何让ssh只允许指定的用户登录 方法1:在/etc/pam.d/sshd文件第一行加入 1auth required pam_listfile.so item=user sense=allow file=/etc/sshusers onerr=fail 然后在/etc下建立sshusers文件,编辑这个文件,加入你允许使用ssh服务的用户名,不用重新启动sshd服务。添加2个用户 1zhangsan 2lisisi 方法2:pam规则也可以写成deny的 1auth required pam_listfile.so item=user sense=deny……

Continue reading

认识/dev/shm

一、/dev/shm理论 /dev/shm/是linux下一个非常有用的目录,因为这个目录不在硬盘上,而是在内存里。因此在linux下,就不需要大费周折去建 ramdisk,直接使用/dev/shm/就可达到很好的优化效果。 /dev /shm/需要注意的一个是容量问题,在linux下,它默认……

Continue reading

Latest articles

Categories

Tags

ACL AD AES AI AWS Ansible Atlassian Azure BMC Blockchain Brocade CDH5 CL210 Cobbler Confd C语言 DDOS DISTINCT DNS Duckdb EKS ELK GCP Ghost Git Glusterfs Go Godaddy Grafana HBA HCIE Hotspot HttpWatch IBM IIS IOS InfluxDB Ingress InnoDB JavaScript Jinja2 KVM Keepalived Mplayer MySQLdb Netlify OpenResty PM PostgreSQL QoS RH318 RH442 RHCA RHCE RHEV RSA SRE SecureCRT Statuscode SublimeText2 TC Telecom Tencentcloud VBA aira2 alpine android anpic apache apm apparmor appfog apr apt-get aria2 array atop audit awk awstats axel backdoor backup bamboo bash bat benchmark bigdata bin bind bitwise book bootstrap bsd c1000 cache capistrano catlog centos centos7 chatops chattr check_mk checkinstall cisco clearall clickhouse cloud-desktop cmdb cms collectd comm compress conver corosync cpu crontab crunchbang css curl date decode dell desktop devops df dhcp diff diskpart django docker dos2unix dpkg drupal etcd excel fail2ban fastcgi fdisk fiddler find firewalld flask flvtool ftp function fuser geek gin github gitlab glances golang google gooupadd graphviz gravatra grep grub2 hadoop haproxy hardware heartbeat helm hexdump hhvm history html http/html/web httplogs https huawei huaweicloud hugo icmp iconv ifconfig inotify iopp ipmitool iptables iredmail iscsi isito it-news java jdk jenkins jira join joomla k3s k8s kdump kernel kingate lamp last leetcode lib light-http linux linux高级篇 ln ls lsi lsof lvm lvs mac mail man mark markdown matplotlib maven memcached microservice mimikatz mkdocs mkpasswd mmonit mod_jk mongodb monit monitor mono moodle mosh mount mpm mrtg mtr my.cnf mysql mysqlbinlog mysqld_multi mysqldump mysqlhotcopy nagios nc nethogs nexus nfs nginx nmon nocatlog node.js nrpe ntfs ntop ntp obs ocr open-falcon openbox opencv openldap openssl openstack oracle oswatch paas pacemaker pam pandas parted pcp pcre pdf percona perl pexpect pgrep php php-fpm ping plsql develope postfix powershell prettify proc prometheus puppeteer pushd pwgen pxe pyecharts python python模块 radmin raid rdesktop read redhat redis redmine regex rh134 rhel7 rhel8 rm rman rootkit route rpm rpmforge rrdtool rsync rsyslog safe saltstack samba scapy screen sed selenium selinux seo seq session set shc sheepdog shell shopt sitemap skydns smokeping snffier snmp socket soft sort spider sql sqlserver squid ss ssh sshpass strace strings su sudo suse svn sysbench syslog-ng sysstat systemd t tar tcpcopy tcpdump tech telnet tengine test testlink threads time tmux tomcat touch tr tsar twisted ubuntu udev ulimit unix unixbench user-agent useradd varnish vbs vercel vi vim visudo vmstat vmware vnc voice vpn vscode vsftp vsftpd vue watchdog web webcam webistrano wget wiki windows wol wordpress workshop wsl x-windows xampp xcache xmllint xtrabackup yule yum zabbix zeromq zip zonetime zookeeper 下载工具 云主机 云原生 代理 加密 古意 吐槽 圈里圈外 娱乐 字符串函数 安全 平台架构 意林 推理 提权 故事汇 故障案例 数据结构 每日看点 民国史 生活 科学记录 站长管理工具 算法 管理 网站架构 翻墙 股票 行业 诗韵 负载均衡 远程管理 面试题

Links

Meta