What is Timelog?When we analyze the performance of the program, we add some logging information to record the time information of each part.The function of the Timelog module is to provide a unified interface to allow adding and saving loggingThe timelog we're using has several drawbacks.1. Fixed size, once full, can not join the new logging2. Each entry will hav
"; itimelogserver. H";. Add the class declaration
// Declare the nested class that implements the itimelog InterfaceBegin_interface_part (timelog, itimelog) // automatically declare three methods of the iunknown InterfaceStdmethod (outputlog) (BSTR * varlogtext );End_interface_part (timelog)// Declare interface ingDeclare_interface_map ()// Declaration FactoryDeclare_olecreate (ctimelogserver)
MySQL trigger, mysql trigger instance
MySQL versions 5.0.2 and later support triggers. A trigger has some time with commands to trigger certain operations.Events include insert statements, delete statements, and update statements..Triggers can be used to record database operations.
1. Create a mysql trigger:
(1) create a trigger with a single execution statement
Create trigger name before | after trigger event
On Table name for each row execution statement
Before | after: Specifies the trigger
, which is often referred to as a mini-application for this reason.The following shows the creation of a route file named Bird.js, which reads as follows:var express = require (' Express '); var router = Express. Router ();//middleware specific to this routerrouter.use (function TimeLog (req, res, next) { Console.log (' Time: ', Dat E.now ()); Next ();}) Define the home page routerouter.get ('/', function (req, res) { res.send (' Birds home Page ')
-application for this reason.The following shows the creation of a route file named Bird.js, which reads as follows:var express = require (' Express '); var router = Express. Router ();//middleware specific to this routerrouter.use (function TimeLog (req, res, next) { Console.log (' Time: ', Dat E.now ()); Next ();}) Define the home page routerouter.get ('/', function (req, res) { res.send (' Birds home Page ');}) Define the About Routerouter.get (
time format, you can omit it.Index: The current day index starting from 0 or 1, preferably not more than 20. The index can also be an additional identity. The log must support rolling log output to prevent the log from being filled with disk.1.1. Accessing log filesThe access log file is primarily for the output server to receive requests, as well as to respond to requests, external requests, and external service responses to requests.1.1.1. Access log File formatIt is divided into two types: A
display query results over a specified timeLog type for MySQL service:Error log: Default enabled, logged service error messages during startup and runBINLG log: Default is not enabled, after logging client Connection server, execute the SQL command other than the querySlow query log: SQL command to display query results over a specified time after logging client connections is not enabled by defaultQuery log: All SQL commands that are executed after
First, log cuttingPrinciple:1, CP a slow log backup2, clear the principle of slow log3, write a script, every day, so OKSecond, find the slow log in the log1, do a log cutting (slow log file is small)2. Find a slow log at a timeLog Time format: # time:161102 3:50:14Filter with grep: Grep-a15 "time:161102 3:50:14" Mysql_slow_query.logSlow log format:# time:161102 3:50:14# [email protected]: xxx[xxx] @ [xx.xx.xx.xx] id:4211754# query_time:18.014797 lock
, each time the need to retrieve the two ends of the userid is poor, and then use these two userid to make the choice of the third query is the data we want. These three searches we only need to read about 10 page to solve the problem. This approach looks like a hassle, but it's the only solution when the amount of data in the table reaches billions of dollars.
Select a log for a period of timeLog table is our most common table, how to design is of
. In place. Out Dum. Out-nodisp-place_only-init_t 5-exit_t 0.005-alpha_t 0.9412-inner_num 2> place_log.out 2> place_log.errVPR net. In arch. in place. In route. Out-nodisp-route_only-route_chan_width 15-pres_fac_mult 2-acc_fac 1-Route 4-initial_pres_fac 8> route_log.out 2> routeVPR net. In arch. In place. Out Dum. Out-nodisp-place_only-init_t 5-exit_t 0.005-alpha_t 0.9412-inner_num 2> place_log.out 2> place_log.errVPR net. In arch. in place. In route. Out-nodisp-route_only-route_chan_width 15-pr
:##DHCPServerConfigurationfile.#see/usr/share/doc/dhcp*/dhcpd.conf.sample#see'man5dhcpd.conf'# Copy related scripts as promptedcp/usr/share/doc/dhcp-4.1.1/dhcpd.conf.sample/etc/dhcp/dhcpd.conf# Copy a scriptvim/etc/dhcp/decpd.conf# Open the configuration file as follows: The Information allocated to the client starting with option, and the operating characteristics of ducp defined by non-optionoptiondomain-name"magedu.com";# Configure a domain nameoptiondomain-name-servers8.8.8.8;# Configure the
maximum length of the string.When dealing with character arrays, don't forget to add '/0 ' or 0 at the end.11. Use the three mesh operatorint max (int a,int b){return a>b?a:b;}12. Convert multiplication to addition to reduce timeLog (A*b) =log (a) +log (b);Convert multiplication to division to prevent overflowA/(b*c) =a/b/c;13, sorting requirements are not high can be used in C + + STL template function sort (), Stable_sort ()int a[n]={...};Sort (a,a
automatically disconnect if not connected)The wait_timeout default is 28,800 seconds, 8 hours, and the connection is disconnected.Net_read_timeout Network Read timeout timeNet_write_timeout Network Write timeout timeLog level for InnoDB:How the cached data in the Innodb_flush_log_at_trx_commit:innodb log is written to the hard disk.0 The least secure, every second to write data to the hard disk, power outages or database corruption data will be lost.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.