Comment On Too Much Sleep

I've frequently posted about my attempts to speed up our system being thwarted by sleepy management decisions about application performance. Our application is essentially: query data, crunch data and save results. Each of those tasks took approximately 1/3 of the run time. A large part of my job is to make the application run more quickly. Every time I fixed something, something else would break, not because I coded something incorrectly, but because of the fragility of our application, other associated applications and the database. For instance... Sleep for the database [expand full text]
« PrevPage 1 | Page 2Next »

Re: Too Much Sleep

2013-01-22 08:04 • by toon (unregistered)
Snoofle, it took me a while to figure out you meant "3 billion or more". Maybe you can write out the word "billion" instead of "3+B"? Otherwise, good to see you sharing those sidebar gems of yours with the rest of the crowd!
(captcha: similis... eeeeew)

Ed: Fixed.

Re: Too Much Sleep

2013-01-22 08:12 • by Warren (unregistered)
I bet after dealing with all that snoofle needs a sleep.

Re: Too Much Sleep

2013-01-22 08:13 • by Yaos
Sleep() is the greatest invention in programming, you can use it to slow down programs and also speed them up.

Re: Too Much Sleep

2013-01-22 08:16 • by Justsomedudette (unregistered)
399667 in reply to 399664
toon:
Snoofle, it took me a while to figure out you meant "3 billion or more". Maybe you can write out the word "billion" instead of "3+B"? Otherwise, good to see you sharing those sidebar gems of yours with the rest of the crowd!
(captcha: similis... eeeeew)
Thanks I had no idea what the heck 3+B meant.

Re: Too Much Sleep

2013-01-22 08:20 • by dkf
399668 in reply to 399667
Justsomedudette:
Thanks I had no idea what the heck 3+B meant.
3+B=E. In hex (or any base of size at least 15).

Re: Too Much Sleep

2013-01-22 08:21 • by ubersoldat
I'm sleepy now

Re: Too Much Sleep

2013-01-22 08:22 • by Honnza (unregistered)
399670 in reply to 399667
Justsomedudette:
toon:
Snoofle, it took me a while to figure out you meant "3 billion or more". Maybe you can write out the word "billion" instead of "3+B"? Otherwise, good to see you sharing those sidebar gems of yours with the rest of the crowd!
(captcha: similis... eeeeew)
Thanks I had no idea what the heck 3+B meant.

On the other hand, 3+0xB would be perfectly unambiguous and clear

Re: Too Much Sleep

2013-01-22 08:29 • by aKatechis
The fact that you used "MM" to designate "million" suggests finance industry, where many gems like these come from. Thank you Wall Street for the endless supply of daily WTFs.

Re: Too Much Sleep

2013-01-22 08:36 • by faoileag (unregistered)
snoofle:
I've frequently posted about my attempts to speed up our system

What bothers me about that sentence is the "our system" which sounds so much present tense.
Not like "a system at a previous employer", not like "in the olden times, when..."
Are you - I shudder thinking about it - still working at that place?

Re: Too Much Sleep

2013-01-22 08:37 • by Steve The Cynic
399673 in reply to 399664
toon:
Snoofle, it took me a while to figure out you meant "3 billion or more". Maybe you can write out the word "billion" instead of "3+B"? Otherwise, good to see you sharing those sidebar gems of yours with the rest of the crowd!
(captcha: similis... eeeeew)

'Sfunny, but I didn't have any problem with this. That may be because I used to work in the finiancial sector in London, so I'm familiar with the quirky suffix notations used by that sector (and in particular with that large American information services provider):

In some asset types, suffix K for thousand, M for million, B for billion. In other asset types, M for thousand, MM for million, MMM or B for billion, etc.

So 3+B said to me "three or more billion", which admittedly isn't quite the same thing as "three billion or more" - I'd write that "3B+".

The best, though, was the day when a large Chinese bank had its IPO, and market information systems around the globe broke. The shares were priced at a per-share level that allowed the markets to trade around 14 billion of them in that one day, a bit more than fits in 32-bit integers...

And the occasional fumble-fingered traders were a source of fun.

One trader in Taipei shifted the local stock exchange index by a percent or so with a single basket order - normally very difficult - because she added a couple of extra zeros to the quantities ordered. She lost her job.

An unfortunate dude in Japan swapped "selling price" and "quantity ordered". The result: he offered to sell 646 000 shares at one yen each, instead of one share at 646 000 yen. This caused some embarrassment to his firm, and some to the exchange, because there were only about 42 000 shares of that company in existence. (This wouldn't have been possible on some markets because they don't accept orders with prices that far away from the correct price. Tokyo wasn't at that time among them.)

Re: Too Much Sleep

2013-01-22 08:38 • by BlueKnot
Management: Let us sleep on that, we'll get back to you...

Re: Too Much Sleep

2013-01-22 08:43 • by pure
snoofle:
We don't need more people; we need better people!


QFT. You, and 90% of the rest of the software industry.

Re: Too Much Sleep

2013-01-22 08:56 • by dgvid
Didn't anyone suggest just pressing the turbo buttons on the servers to slow them down? That always worked for those DOS games written in MS BASIC.

Re: Too Much Sleep

2013-01-22 08:58 • by Andrew (unregistered)
399677 in reply to 399675
pure:
snoofle:
We don't need more people; we need better people!


QFT. You, and 100% of the rest of the software industry.
FTFY.

Re: Too Much Sleep

2013-01-22 09:00 • by snoofle
399678 in reply to 399672
faoileag:
...Are you - I shudder thinking about it - still working at that place?
Yup; WTFInc is where all the good stories come from!

Re: Too Much Sleep

2013-01-22 09:15 • by Spudley (unregistered)
399679 in reply to 399671
aKatechis:
The fact that you used "MM" to designate "million" suggests finance industry, where many gems like these come from. Thank you Wall Street for the endless supply of daily WTFs.


The best bit of that, of course, is knowing how high paid most finance devs are.

Grrrr.

Re: Too Much Sleep

2013-01-22 09:35 • by Shawn H Corey (unregistered)
To sleep, perchance to dream...

...of getting a better job.

Re: Too Much Sleep

2013-01-22 09:46 • by faoileag (unregistered)
399683 in reply to 399678
snoofle:
faoileag:
...Are you - I shudder thinking about it - still working at that place?
Yup; WTFInc is where all the good stories come from!

Ah, I get it: you work there so that you can get material for The Daily WTF! Wow, that's what I call dedication! Keep up the good work! :-)

Re: Too Much Sleep

2013-01-22 09:47 • by onitake (unregistered)
You could have tried telling the DBAs that the "M" in "512MB" was a typo and it should have read "512GB"...

Re: Too Much Sleep

2013-01-22 09:50 • by Ciaran (unregistered)
Now the trouble is over, everybody got paid
Everybody is happy, they are glad that they came
Then you go to the place where you've finally found
You can look at yourself, sleep the clock around

"Sleep the Clock Around" by Belle & Sebastian

Re: Too Much Sleep

2013-01-22 10:08 • by pif (unregistered)
399686 in reply to 399673
Steve The Cynic:

So 3+B said to me "three or more billion", which admittedly isn't quite the same thing as "three billion or more" - I'd write that "3B+".


http://dilbert.com/strips/comic/2005-11-18/

CAPTCHA: dignissim; indeed, this comment is dignissim to be published!

Re: Too Much Sleep

2013-01-22 10:27 • by Coyne
399687 in reply to 399666
Yaos:
Sleep() is the greatest invention in programming, you can use it to slow down programs and also speed them up.


The first thing that leaped into my fertile mind when I read this was: Negative sleep intervals!


begin
much program processing
sleep(-45000);
clean up
end


Presto: A program that ends before it begins! What a concept!

Re: Too Much Sleep

2013-01-22 10:56 • by Anketam
I remember reading all of these on the sidebar. It is great to see all the sleep incidents compiled into a single article. Sad thing is this is they have done worse.

Re: Too Much Sleep

2013-01-22 11:22 • by Vilx- (unregistered)
This is just sad.

Re: Too Much Sleep

2013-01-22 11:34 • by Anon (unregistered)
399690 in reply to 399686
pif:
Steve The Cynic:

So 3+B said to me "three or more billion", which admittedly isn't quite the same thing as "three billion or more" - I'd write that "3B+".


http://www.dilbert.com/fast/2005-11-18/

CAPTCHA: dignissim; indeed, this comment is dignissim to be published!


FTFY. TRWTF is not using the "fast" version of Dilbert.

Re: Too Much Sleep

2013-01-22 11:56 • by RichP
It's the bitchy backseat driver antipattern!

Speed up, or we'll never get there.
Slow down! are you trying to kill us?
Speed up!
Slow down!

Re: Too Much Sleep

2013-01-22 11:56 • by Zylon
Editorial: "Sleep to cool the cpu's" should be "Sleep to cool the CPUs".

Re: Too Much Sleep

2013-01-22 12:03 • by Bean Counter (unregistered)
We don't need more people; we need better people!
Oh, dear, that sounds like it might cost money.

ears -> close();
brain -> off();

Re: Too Much Sleep

2013-01-22 12:09 • by Oscar (unregistered)
Obviously the root problem is that Snoofle keeps speeding things up faster than the rest of the company can absorb his goodness and brilliance. Therefore his manager should instruct him to sleep() 60% of every day.

Re: Too Much Sleep

2013-01-22 12:09 • by annihilatorg
No, you cats are looking at this all wrong...

Your code is GREENER! Let the MBAs know that you've saved thousands of dollars in operating costs by reducing electricity and cooling costs while the sales guys start serving up the new marketing materials on unbleached, 100% recycled paper.

Re: Too Much Sleep

2013-01-22 12:14 • by cellocgw
399698 in reply to 399668
dkf:
Justsomedudette:
Thanks I had no idea what the heck 3+B meant.
3+B=E. In hex (or any base of size at least 15).


Hmmm: " sqrt(-1)" " less than three" "three plus B"

Anyway, "3+B" is NewSpeak for "very very very bad"

Re: Too Much Sleep

2013-01-22 12:32 • by chubertdev
399699 in reply to 399694
pure:
QFT. You, and 90% of the rest of the software industry.


Indeed. That's one of the reasons why I left my last job. PHB was demanding a project with no specs, and was wondering why it was taking so long. Hired a contractor that was so clueless that he actually impeded progress.

Zylon:
Editorial: "Sleep to cool the cpu's" should be "Sleep to cool the CPUs".


Actually, it should be "Sleep to cool the processors", I assume.

Re: Too Much Sleep

2013-01-22 12:36 • by Evo
I have to admit I'm rather enjoying snoofle tuesday.

Re: Too Much Sleep

2013-01-22 12:48 • by Jeff (unregistered)
You just made my head hurt.

Re: Too Much Sleep

2013-01-22 13:19 • by jarfil (unregistered)
Platters? Like "disk" platters?
Come on, even cheap interns know how to solve that, just buy $3MM of SSDs!

captcha: consequat, conesquat? yeah, I'm going with the cone thing.

Re: Too Much Sleep

2013-01-22 13:21 • by snoofle
399703 in reply to 399696
Oscar:
Obviously the root problem is that Snoofle keeps speeding things up faster than the rest of the company can absorb his goodness and brilliance. Therefore his manager should instruct him to sleep() 60% of every day.
Where do you think I get the time to write these articles?

Re: Too Much Sleep

2013-01-22 13:55 • by jay (unregistered)
They use sleep's to align with asynchronous processes? Wow. So you just put in an arbitrary sleep and hope that the other process is done by then? This sounds like mysterious bugs just waiting to happen. The program could work today and fail tomorrow.

Re: Too Much Sleep

2013-01-22 14:01 • by snoofle
399706 in reply to 399702
jarfil:
Platters? Like "disk" platters?
Come on, even cheap interns know how to solve that, just buy $3MM of SSDs!
It's not that simple. These are the high availability variety of disk. You know, the kind that could get hit with a shotgun blast and not miss a beat. We spend about $15,000 per TB for storage.
SSDs sound like a good idea, but I don't know that there are any that are of the HA variety.

Re: Too Much Sleep

2013-01-22 14:03 • by finance developer (unregistered)
399707 in reply to 399679
Spudley:
aKatechis:
The fact that you used "MM" to designate "million" suggests finance industry, where many gems like these come from. Thank you Wall Street for the endless supply of daily WTFs.


The best bit of that, of course, is knowing how high paid most finance devs are.

Grrrr.


Easy - move to where the finance jobs are and apply.

If (like most people) you can't afford to move all the way into a city then prepare to travel 100 miles a day on expensive and overcrowded trains.

Re: Too Much Sleep

2013-01-22 14:18 • by Kim (unregistered)
I've been a long time lurker of Side Bar WTF, and the stories from SnoofleCorp are so unlikely to be created by a fertile mind that they must be true. So glad to see you sharing the front page, but snoofle should consider be a consultant for Dilbert...

Re: Too Much Sleep

2013-01-22 14:18 • by letatio (unregistered)
Since I was not allowed to rewrite the query part of the application, instead of letting me fix the queries, they made me add sleeps

Is there someone who tested what happens when you just refuse to do something like that and stick to something like I refuse to put in these very questionable workarounds for severe bugs. It was pure luck that it worked until now and with the sleep workaround it will be pure luck whether it works in the future. I want to fix the bug..

Do they fire you for that just like that? (And is this really bad?)

Re: Too Much Sleep

2013-01-22 14:49 • by n_slash_a (unregistered)
399711 in reply to 399695
Bean Counter:
We don't need more people; we need better people!
Oh, dear, that sounds like it might cost money.

ears -> close();
brain -> off();

+1

Re: Too Much Sleep

2013-01-22 14:52 • by John Dirt (unregistered)
HA-HA. I so glad that you are having problems with your application! HA-HA...

Re: Too Much Sleep

2013-01-22 15:37 • by biziclop
I once wrote a webapp that amongst other things, had to redeem vouchers.

Marketing looked at the result and told me that the code was too quick. I had to insert a sleep call in the processing code because, they reasoned that people wouldn't believe it worked if they got an instant response.

As bonkers as it sounds, they were probably right: a couple of seconds of extra waiting did make it look much more serious and official.

Re: Too Much Sleep

2013-01-22 15:58 • by urbalt (unregistered)
399715 in reply to 399714
biziclop:
I once wrote a webapp that amongst other things, had to redeem vouchers.

Marketing looked at the result and told me that the code was too quick. I had to insert a sleep call in the processing code because, they reasoned that people wouldn't believe it worked if they got an instant response.

As bonkers as it sounds, they were probably right: a couple of seconds of extra waiting did make it look much more serious and official.


I guess I barely dodged a snoofle when I "optimized" a former colleague's poorly-written voucher-redemption code that pulled and processed hundreds of times as many records from the database than it had to, resulting in delays of over a second in the production app. Marketing _didn't_ ask me to change the behavior back to original. On the contrary--the inefficiency was orders of magnitude greater in test environments, and they were very pleased that they no longer had to wait up to 15 seconds per click to test voucher code configurations. (Users--marketing no less--testing their changes: TRWTF, I know.)

Re: Too Much Sleep

2013-01-22 16:00 • by Jack (unregistered)
399716 in reply to 399714
biziclop:
I once wrote a webapp that amongst other things, had to redeem vouchers.

Marketing looked at the result and told me that the code was too quick. I had to insert a sleep call in the processing code because, they reasoned that people wouldn't believe it worked if they got an instant response.

As bonkers as it sounds, they were probably right: a couple of seconds of extra waiting did make it look much more serious and official.
How does that work out when Marketing runs a big promo without telling anyone, and the servers get slammed with traffic? Could you at least put in some logic that says "if the user hasn't already waited three minutes, sleep 2 seconds"?

Re: Too Much Sleep

2013-01-22 16:03 • by Tom (unregistered)
399717 in reply to 399715
urbalt:
(Users--marketing no less--testing their changes: TRWTF, I know.)
Excuse me, but which alternate universe were you visiting with the aid of banned substances again?

Re: Too Much Sleep

2013-01-22 16:41 • by Kjella (unregistered)
"We don't need more people, we need better people" is so true. It's like grabbing candidates from "Worst cooks in America" thinking ten of them can do better than one professional chef. Also a related demotivator I love:

http://demotivators.despair.com/demotivational/incompetencedemotivator.jpg

Re: Too Much Sleep

2013-01-22 17:09 • by biziclop
399720 in reply to 399716
Jack:
biziclop:
I once wrote a webapp that amongst other things, had to redeem vouchers.

Marketing looked at the result and told me that the code was too quick. I had to insert a sleep call in the processing code because, they reasoned that people wouldn't believe it worked if they got an instant response.

As bonkers as it sounds, they were probably right: a couple of seconds of extra waiting did make it look much more serious and official.
How does that work out when Marketing runs a big promo without telling anyone, and the servers get slammed with traffic? Could you at least put in some logic that says "if the user hasn't already waited three minutes, sleep 2 seconds"?


Good question but no, we weren't that subtle. There weren't going to be enough active vouchers for that to be a problem any anyway, if you waited 3 minutes already, you won't even notice the extra 2 seconds :)

Re: Too Much Sleep

2013-01-22 17:11 • by jarfil (unregistered)
399721 in reply to 399706
snoofle:
It's not that simple. These are the high availability variety of disk. You know, the kind that could get hit with a shotgun blast and not miss a beat. We spend about $15,000 per TB for storage.
SSDs sound like a good idea, but I don't know that there are any that are of the HA variety.

HA is a myth, there are only three kinds of drives: bad, worse, and trash.
MTBF mostly states how many drives did the manufacturer trow at accelerated aging tests, doesn't change the fact that "bad" and "premium HA bad" drives get similar failure rates.

As for SSDs, currently there are SLC, MLC and TLC drives (see: bad, worse, trash). Get yourself a bunch of SLC drives, and you'll see better performance and reliability than with any of those platter clunkers. As a bonus you get non-desctructive failure modes like just going into read-only (aka: RAID friendly) instead of dying entirely.
« PrevPage 1 | Page 2Next »

Add Comment