* disable lower c-states
* enable adaptive coalesce in the network driver
* mount volumes with noatime
1–10 of 47 posts
* disable lower c-states
* enable adaptive coalesce in the network driver
* mount volumes with noatime
```
#include
#include
int main(int argc, char argv[]) { int i = 0; time_t timep;
/*
* ok so now we are printing something
**/
printf("Greetings!\n");
/*
* this is a for loop from 0..9
**/
for(i=0; i
}```
now, the canonical
```
$> gcc tz-test.c -o obj/tz-test
```
now do this
```
$> unset TZ
$> strace -ff ./obj/tz-test 2>&1 | grep 'local' | wc
10 77 851
$> export TZ=:/etc/localtime$> strace -ff ./obj/tz-test 2>&1 | grep 'local' | wc
1 5 59
```moral, always set TZ to avoid localtime(3) from stat'ing /etc/localtime :o)
https://planetscale.com/blog/what-is-n-1-query-problem-and-h...
Aside from the performance gains, it's very satisfying to go from 1,000+ inefficient DB queries to 1-2 optimized queries.
also less logging. Seen this pop up way too many times
- Delete as much code as possible
I once had a project where a SAP system was crawling and literally causing company-wide stoppages. We found a job that literally ran every minute of every day and it processed a table that contained a few thousand tasks. This was something that could be done once per hour, and only during business hours. Furthermore, it was re-processing thousands of records each time it ran. In reality, after a record was processed once, it could be deleted from the table.
We emptied out the table, and scheduled the job to run hourly. The whole company noticed an immediate improvement.
This pattern happens a lot. Someone builds a polling system that hits the server once a second in order to see if a task finished. A cron job runs every 5 minutes. All data is processed in a daily job, instead of doing a 24 hour cutoff.
The world is filled with computers doing useless work. Mostly, no one notices.
also less logging. Seen this pop up way too many times