Performance Analysis and Optimization of a Single-Threaded TCP Server Using Linux Perf Monitoring Tools
Roll Number: 2022052 & 2022054
-Find the PID which is runinng on the port p using
$ sudo lsof -i :8080
This command will result in the PID (PID) time and name of the server that is runnning.
Now kill the process using the command:
$ sudo kill -9 <PID>
perf_event_paranoid is working fine with value 3 which can be changed by:
$ sysctl kernel.perf_event_paranoid=3
$ make single-threaded
$ sudo perf stat -e cycles,instructions,cache-references,cache-misses,context-switches,cpu-migrations,page-faults ./single-threaded-server
- Run the following command on the second terminal.
$ sh n_seq_clients.sh 10 ./single-threaded-client
-
Observe the results in
output.txt -
NOTE:Ensure that commands are run in the aforementioned order for successful compilation!
$ make concurrent-thread
$ sudo perf stat -e cycles,instructions,cache-references,cache-misses,context-switches,cpu-migrations,page-faults ./concurrent-server-thread 10
- Run the following command on the second terminal.
$ ./concurrent-client 10
- Observe the results in
output.txt
$ sudo perf stat -e cycles,instructions,cache-references,cache-misses,context-switches,cpu-migrations,page-faults ./select-server
- Run the following command on the second terminal.
$ sh n_con_clients.sh 10 ./single-threaded-client
If you have any questions or feedback, you can reach out to Akshat Raj Saxena
Special thanks to the creators of JavaFX and the contributor to this project Akshat Karnwal.