Posts

Showing posts from June, 2009

MYSQL: Query Execution Basics

Image
1. The client sends the SQL statement to the server. -> The protocol is halfduplex, which means that at any given time the MySQL server can be either sending or receiving messages, but not both. It also means there is no way to cut a message short. The client sends a query to the server as a single packet of data. This is why the max_packet_size configuration variable is important if you have large queries. Once the client sends the query, it doesn’t have the ball anymore; it can only wait for results. The response from the server usually consists of many packets of data.When the server responds, the client has to receive the entire result set. It cannot simply fetch a few rows and then ask the server not to bother sending the rest. If the client needs only the first few rows that are returned, it either has to wait for all of the server’s packets to arrive and then discard the ones it doesn’t need, or disconnect ungracefully. Neither is a good idea, which is why appropriate LIMIT

How do I Use the Linux Top Command?

The Unix top command is designed to help users determine which processes are running and which applications are using more memory or processing power than they should be. The top command is very easy to use but you should know the things in details. The output of to is : top output: top - 22:09:08 up 14 min, 1 user, load average: 0.21, 0.23, 0.30 Tasks: 81 total, 1 running, 80 sleeping, 0 stopped, 0 zombie Cpu(s): 9.5%us, 31.2%sy, 0.0%ni, 27.0%id, 7.6%wa, 1.0%hi, 23.7%si, 0.0%st Mem: 255592k total, 167568k used, 88024k free, 25068k buffers Swap: 524280k total, 0k used, 524280k free, 85724k cached PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 3166 apache 15 0 29444 6112 1524 S 6.6 2.4 0:00.79 httpd 3161 apache 15 0 29444 6112 1524 S 5.9 2.4 0:00.79 httpd 3164 apache 15 0 29444 6112 1524 S 5.9 2.4 0:00.75 httpd 3169 apache 15 0 29444 6112 1524 S 5.9 2.4 0:00.74 httpd 3163 apache 15