Grokking Operating Systems and Networking for Backend Engineers
Vote

0% completed

​

Tracing System Calls With strace

One line of output explained why every order took 120 ms longer than its handler's own work:

Output:

recvfrom(3<TCP:[127.0.0.1:<port>->127.0.0.1:5432]>, "INSERT 0 1\n", 4096, 0, NULL, NULL) = 11 <0.120176>

Checkout had asked the kernel for data on its socket number 3, which is a connection to port 5432, the database. The answer was the 11 bytes INSERT 0 1, and the call took 0.120 seconds to return. Checkout's own logs said nothing about that wait, because the code that waited was a single recv call inside a library.

.....

.....

.....

Like the course? Get enrolled and start learning!

Reading Progress

0%


Vote for new content