Home PC Games Linux Windows Database Network Programming Server Mobile  
  Home \ Linux \ How to view the Linux QPS     - Linux security configuration (Linux)

- BCP importing and exporting large amounts of data Practice (Database)

- Linux 6 install Oracle 11g (64bit) (Database)

- Linux character device - automatically creates the device nodes and devices (Linux)

- Android source code compiled fatal error solutions (Programming)

- Ubuntu 14.04 after the restart the default maximum screen brightness solutions (Linux)

- Oracle Standby Redo Log experiment (Database)

- Let you Fun Ubuntu desktop eleven weapon (Linux)

- MongoDB relations, references, index query coverage (Database)

- Linux, MySQL / MariaDB Galera Cluster Setup Process (Database)

- MySQL 5.5 on master-slave copy filter (Database)

- Nodejs complete installation instructions for Express (Linux)

- DRBD Principle and Features Overview (Server)

- Clojure programming languages: take full advantage of the Clojure plug-in Eclipse (Programming)

- The difference between free command displays the buffers and cache (Linux)

- Linux platform NTOP Installation and Configuration (Linux)

- Forwarding module with Apache reverse proxy server (Server)

- Sublime Text 3 best features, plug-ins and settings (Linux)

- Let your PHP 7 faster (GCC PGO) (Linux)

- Linux Firewall Builder shorewall (Linux)

  How to view the Linux QPS
  Add Date : 2016-06-15      
  Background: There is a referral service online, larger than the log, under qps want to make sure is not too high

Question: qps how to view the log based on a service

tail -f XXX.log, the log can be found in the following format:
[8708-10 14:51:44 638 INFO] [async task worker [61]] recommend.components.KeywordService [87] - cateid = 252 pageNum = 1
[8708-10 14:51:44 666 INFO] [async task worker [62]] recommend.components.KeywordService [87] - cateid = 42205
[8708-10 14:51:44 673 INFO] [async task worker [0]] recommend.components.KeywordService [87] - cateid = 29 pageNum = 2
[8708-10 14:51:44 677 INFO] [async task worker [1]] recommend.components.KeywordService [87] - cateid = 252 pageNum = 3

Log specification, there is a "request time", through the "request time" estimated qps services, follow these steps:
(1) make a request to have a go first and only line of logs, commonly used tools are grep, this case needs to grep recommend.components.KeywordService, the results obtained, a request corresponding to the line of the log
(2) Remove the time this column, commonly used tool is cut or awk, here is what you cut (linux everyone to look up man)
    -d parameter, separated by a certain character
    -f parameter, the first of several columns separated after removal
    In this example, after following the "space" to separate the time in the second column
1,2-step operation performed, the results obtained for the
(3) the results go heavy, take count, commonly used tools are uniq, parameter -c

Therefore, the entire shell command is:
Command: tail -f XXX.log | grep recommend.components.KeywordService | cut -d '' -f2 | cut -d ':' -f3 | uniq -c
Description: Take an incremental | request fetches a row | time to intercept it | out to intercept the seconds | to re-take the count
The result is
You can see 14: 51: 43, a total of 136 log
    44, there are 126 log
    45, there are 115 log
qps conclusion of this module, the single is about 120-130
- OpenSSL to generate public and private key (Linux)
- Ubuntu Backup and Recovery (Linux)
- Ubuntu way of decompressing files (Linux)
- Function Getting the Linux shell (Programming)
- MySQL combination Git achieve differential backups can be used in the production environment (Database)
- Struts2 : combobox label use (Programming)
- Management and application Oracle external table (Database)
- Ubuntu 14.04 / 12.04 subscribe users to install software Liferea 1.10.10 (Linux)
- CentOS7 method to upgrade the kernel to 3.18 (Linux)
- Linux systems for entry-learning: Install closed-source packages in Debian (Linux)
- DVD production using CentOS installation source within the company Yum (Linux)
- C ++ Supplements - malloc free and new delete the same and different (Programming)
- for (int a: i) the use of the Java programming (Programming)
- Linux (CentOS) directory file management and file system file compression packing (Linux)
- C # / iOS / Android Universal Encryption and decryption (Programming)
- Oracle metadata Reconstruction experiments (Database)
- Build Nginx + uWSGI + Flask operating environment under CentOS 6.4 tutorial (Server)
- Golang use Oracle database on Ubuntu 14.04 (Linux)
- BackTrack (BT3, BT4) Linux installation tutorial (Linux)
- Network Security Basics Linux command (Linux)
  CopyRight 2002-2022 newfreesoft.com, All Rights Reserved.