So, I set off this morning to renew my residence permit, which expires in a couple of weeks... I arrived in the office about 45 minutes after it opened, pulled a number and sat down. It turned out that that was the last number issued before someone came and pasted a sheet over the machine saying "no more numbers today -- and people without numbers will not be served".
Four hours later, it was finally my turn; nearly everyone else had left. At first, people went in at a rate of around 10 an hour, but towards the end large time periods went by without any perceptible activity. Some of the few people left wondered whether the civil servants were taking time off for a break while people waited outside.
When I finally got in, I found I didn't have enough paperwork with me *sigh*. But at least I now know what I need, so I'll try again in a couple of days... only this time I'll try to be there as soon as the office opens. And the civil servant who processed my case said that I could very likely get an unlimited residence permit when I renew my current (five-year) one, which means no more such trips. (Unless I live outside Germany for more than half a year at a time, if I remember correctly -- then I might have to reapply upon re-entry.)