I discovered that on my Ubuntu 22 server, attempting to write to a file, often induces around 20ms delay, even when only writing a few bytes. Here is some basic code that demonstrates the problem: And here is the output: It seems more likely to happen if there is a bit of delay between attempts, and also more likely to
Tag: performance
understand sysstat sar memory output
I’m preparing for more traffic in the days to come, and I want to be sure server can handle it. Running sar -q, the load of “3.5” doesn’t seem much on 32 CPU architecture: However, I’m not sure about the memory. Running sar -r shows 98.5% for the %memused and only 13.60 for %commit: running htop seems OK too: 14.9G/126G.
C++ Linux fastest way to measure time (faster than std::chrono) ? Benchmark included
I’m trying to profile a program where certain critical parts have execution time measured in < 50 nanoseconds. I found that my timer class using std::chrono is too expensive (code with timing takes 40% more time than code without). How can I make a faster timer class? I think some OS-specific system calls would be the fastest solution. The platform
RabbitMQ in Linux randomly dropping connections in some deployment
In GNU/Linux I have an issue with an application I have made. It works in my development environment, most of the components running in dockers or natively, but it randomly (often, but not always) fails in the server environment where it needs to be deployed. Infrastructure: Both servers seem to have enough resources -4 CPUs, 4 GB RAM. The machine
Usage of getc with a file
To print the contents of a file one can use getc: How efficient is the getc function? That is, how frequently does it actually do operating system calls or something that would take a non-trivial amount of time? For example, let’s say I had a 10TB file — would calling this function trillions of times be a poor way to
Comparing epoch timestamps in a log and checking if x time has elapsed between the previous and current timestamp in the list
I have a log file consisting of a list of epoch 19-digit timestamps, for example I would like to iterate through this list, and compare the previous timestamp to the current timestamp in the list and echo a message if x duration of inactivity as occurred, ex: What would be the most efficient method to iterate through the list such
SSD vs. tmpfs speed
I made a tmpfs filesystem in my home directory on Ubuntu using this command: Then I wrote this Python program: The result: I am confused about this result. Isn’t the tmpfs a file system based on RAM and isn’t RAM supposed to be notably faster than any hard disk, including SSDs? Furthermore, I noticed that this program is using over
Magento extremely slow after migration to a new AWS instance
We are using t2.large as instance type and php v 7.2 Magento2 multi-store is taking 25 seconds to load The product page is extremely slow We are Bitnami cloud image of Magento Does the server location affects the performance ?? Do I have to use a Load balancer?? I am using a built-in cache for Magento and flat category The
c++ Windows debug performance is very slow vs linux
I have a Cmake OpenCV project. If I execute the same project under Windows in the debug configuration is the performance very bad and I place zero breakpoints. In the release modus, I get the same performance as on Linux. Why is the performance better on Linux than on Windows? Can I fix the performance issue on window? I use
Searching a text file backwards from the end
I’m trying to find the string containing the substring in a text file by starting at the end. The file has tens of millions of lines. (The requirement is to read from End of the File. I cannot use sed/awk/grep etc) The below program does the job but it takes a long time. How can I make it run faster?