Score:0

Why is my headless Ubuntu server (20.04) terminal slow to display the command prompt after loggin in?

in flag

I have a weird problem, I have a server running headless Ubuntu 20.04, and I have setup SSH access local only via PuTTY, but when I open PuTTY and connect to the server, and after I've entered the login details, as soon as I press enter to enter my password, it takes about 3-5 minutes for the command prompt to appear, simple command like clear, works fast, but when I upgrade by using apt get upgrade, normally it would be fast with the status bar at the bottom moving really fast, but recently (in the last week or so), that status bar has been moving really slow, and when apt starts fetching files for upgrading, the fetching is also very slow, but the downloads are vey fast, it seems there's a huge time delay between when apt fetches a file and when it unpacks it.

at one point when there was some upgrades, there was only some library files and PHP related files, around 15 files in total, it took 15 minutes for the status bar to finish and the command prompt returns, but if I were to reboot the server, everything runs really quickly, then somewhere within a week it slows down.

How can I tell what's causing the server to suddenly start crawling?

waltinator avatar
it flag
Look at the logs! `sudo journalctl -b 0 -u NetworkManager`. Read `man journalctl`.
Micheal Saunders avatar
in flag
I looked at the logs, and nothing was found unusual. I wanted to use a packet sniffer, but being that the server is using headless Ubuntu, wireshark is out of the question. Is there a CLI packet sniffer that can run continuously and record it's output to a text file, until I press CTRL-C or Q, much the same way as htop or top runs?
waltinator avatar
it flag
Yes. Read `man tcpdump`. You can capture data in `.pcap` format on your headless server, transfer the `.pcap` file to a GUI system and load it into `wireshark`.
Micheal Saunders avatar
in flag
Thanks, I found the problem using tcpdump, the network was bottlenecking during the transfer of backups from other workstations, for some reason, and I can't figure it out, the network, even though I'm using GiGaBit LAN throughout, was actually using 100MB, then dropping to 10MB when transferring large files.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.