About a year ago I was asked to fix a very serious performance issue of a tourism-related website which normally had about a few thousand visits a day. When I first met the owner he was ranting for half an hour about how he doesn't trust developers because thery are all unreliable etc. The website was written in PHP and used PostrgreSQL as database backend. The problem was that the server kept crashing every few hours and was generally very slow. The sysadmin of the server suggested the owner to buy an even more powerful server with more RAM to solve the problem. Now I am not really a web developer and I don't have much experience with PHP and these kind of systems but I was the only programmer the owner could get. After digging through the problem and some testing I realized that the website actually couldn't handle more than 4-5 visit per minute, and the server was overwhelmed with only a few hundrends of visits easily. The first thing I noticed that actually the website pulled *every* *single* *line* of text on the website from the database. This sounds WTFish for me, but the sysadmin ensured me that that's the way websites work, and since I'm not experienced with web development, I don't know if that's true or not. None the less, PostgreSQL should be able to handle a few hundred queries a minute, so that shouldn't be a problem. Now the real WTF was that I realized that before every single page load the PHP scripts pulled every single line (>100000 lines) from the database, put them into an array (and if I remember correctly, PHP arrays are hashtables as well in the same time), and then looked them up from the array at the appropriate locations. If it were up to me I would have just put all the text inside the PHP files, but since it was a quite large website and this "logic" was deeply rooted in every PHP file, I had to find an other solution. Unfortunately time and cost constraints didn't allow me to rewrite the whole mess. My solution was to create an inherited class of the inbuilt PHP array class which only pulled any line of text from the database when it was required (or if it was required), and then cached them with memcached. There might be a better solution, I don't know, as I mentioned, I am not a web developer, but my solution worked perfectly and after I introduced my changes to the live system (there were no version control, of course), everything was fine. No crashes and slowdowns anymore. On the side note, the owner of the website started blaming me for some other disasterous aspects of the website right after I fixed the speed issue and it started to get a bit personal, so I decided that the whole headache didn't worth it. Long story cut short, I have never got payed for the fix. Last time I heard about the guy he was trying to hire a web devlopment agency to do the job and clean up the website
DrJokepu
@DrJokepu
Best posts made by DrJokepu
-
Realy dynamic website
-
RE: Mashup Challenge $100,000 prize - WTF if Spectate Swamp wins?
@SpectateSwamp said:
I didn't make that rediculous statement ...
-
RE: Forum Guidelines Discussion
I am way too lazy to edit that, but basically that's my opinion:
[23:01] <DrJokepu> my problem with phil's list that the whole point of sarcasm that you don't tell it's sarcasm. it's like an iq-test. tagging sarcasm with </sarcasm> is plain faggotry i think [23:01] <mps> dr, stfu noob [23:01] <mps> DrJokepu: was that sarcasm? [23:02] <DrJokepu> ^_^ [23:02] <hedonismbot> no u! [23:02] <drjokepu> was that sarcasm? [23:02] <mps> DrJokepu: your face is sarcasm, fgt [23:02] <morbz> DrJokepu: I agree. [23:03] <mps> I just dislike coddling people [23:03] <mps> I think we should expect a certain level of intelligence on the forum [23:04] <mps> of course that doesnt explain why morb is here [23:05] <morbz> DrJokepu: Can you imagine if Jonathan Swift had been like "Begin sarcasm.." [23:05] <ammoq> DrJokepu: why don't you post your opinion about the sarcasm-tag in phil's thread? I'm sure many people agree with you.
Latest posts made by DrJokepu
-
RE: Minor Solitaire WTF
The real WTF is the colour scheme he'is using. I mean, come on, even the default blue is better than this.
-
RE: I'm considering switching banks
@Kyanar said:
New Zealand. But to be more specific, the online banking is open 24/7, but between 10PM and 6AM no transactions are permitted - they get held for the next business day. It's read only except for inter-suffix transfers (moving money between your own accounts).
I think it probably has to do something with the regulations or the clearing system of your country. Here in the UK transactions were queued until the next workday and then it took about 2-3 workdays while they got processed until recently. About 4 months ago they introduced some changes so all transactions now take place real time 24/7 and get processed in 2-3 hours at most. -
RE: I'm considering switching banks
@Kyanar said:
In this country, ALL banks do that - online banking is out from 10PM to 6AM. Which one should I switch to?
I don't know, where do you live? I live in the UK and have an account at HSBC and their Internet Banking service is open 24/7, except for international payments.
-
RE: I'm considering switching banks
@rohypnol said:
What's ATB? Really, I live in Romania,WTF is ATB? Should I know?
Let me google that for you... -
RE: Very Random Numbers
@mallard said:
@superjer said:
Out of curiosity, I used this method in a script to generate 100,000 IDs. Here are the results:
Generated 100000 unique IDs, resulting with 56983 UNIQUE IDs.
Sorted by increasing popularity:
...
9cdfa26181dd4af6f5585eae4f57970b x3
e31ba89e87cc2fcc8605c20618b3d5b6 x3
25c23fb3191ef61cba0e9b6b1db8dfff x3
f5b8c2566771a688a65cf97202fb5f0f x3
8f81fa8534d98e0f3bbaf3bda5a1c6c5 x3
244c636d9a0ef0dbe7c373431e41ebdf x3
199723158503538b8a685601d083511f x3
f7c67babedafc73bfd48c1d5fac222a8 x4
9517fd0bf8faa655990a4dffe358e13e x2234
cfcd208495d565ef66e7dff9f98764da x39982And a quick Google reveals that cfcd208495d565ef66e7dff9f98764da=md5(0) and 9517fd0bf8faa655990a4dffe358e13e=md5("INF").
FEAR MY AWESOME GDATA SKILLZ!!!!!11cfcd208495d565ef66e7dff9f98764da = empty string 9517fd0bf8faa655990a4dffe358e13e = INF f7c67babedafc73bfd48c1d5fac222a8 = 81956 199723158503538b8a685601d083511f = 80685 244c636d9a0ef0dbe7c373431e41ebdf = 186534 8f81fa8534d98e0f3bbaf3bda5a1c6c5 = 84252 f5b8c2566771a688a65cf97202fb5f0f = 81384 25c23fb3191ef61cba0e9b6b1db8dfff = 71535 e31ba89e87cc2fcc8605c20618b3d5b6 = 470180 9cdfa26181dd4af6f5585eae4f57970b = 284634
-
RE: Grr, WTF Channel 4!
I think Channel 4 On-Demand (4oD) is a great idea but the underlying P2P engine Kontiki should really die in a fire. And the whole Windows Media Player based approach. The BBC iPlayer (not the Flash-based version, but the "classic" one) is using the same technology and it sucks too. They should really make a Flash or Silverlight based version.
-
RE: Thanks for the export
@Welbog said:
Now I basically have two choices here: either I admit that I was talking bullshit or go on and edit Wikipedia to show everyone that I Was Right™. I guess I will chose the latter.I am punching you over the Internet with my mind.
tl;dr, an ellipsis glyph looks like three period glyphs close together, but it's still just one ellipsis. You don't call an equality sign "equality signs" because its glyph has parts that don't touch, do you?
-
RE: Thanks for the export
@Spectre said:
@DrJokepu said:
... - Ellipsis
FTFY.
Actually, it is ellipses. That is, the plural of the Latin "ellipsis". If you don't like declention, you could say "ellipsises" but that's just weird. I am sure you can figure out yourself why it is in plural form. -
RE: Thanks for the export
@dtech said:
(is that the english word for ; ? It is in dutch)
Quick English Special Character Name Cheat Sheet
. - Dot , - Comma ? - Question Mark ! - Exclamation Mark : - Colon ; - Semicolon ' - Apostrophe " - Quotation Mark $ - Dollar sign £ - Pound sign ... - Ellipses () - Parentheses, or "round brackets" for the mentally challenged [] - Square brackets {} - Curly brackets & - Ampersand ^ - Caret * - Asterisk # - Hash sign / Number sign @ - At sign ~ - Tilde - - Hyphen