Better HN
topnewbestaskshowjobs
Log inSign up

rehack

530 karma · joined Oct 19, 2011 (15y ago) · 147 submissions

HN should provide an option to delete accounts. Admin, please delete this account, with all my posts, with no archives, as and when the delete feature is added.
Submissions

comment 13y ago · link · parent

>Do you know where that reduced average latency is coming from? Is it because nginx is serving static assets that would tie up an apache worker that could be running/serving PHP in apache? If so, you can do the same thing by offloading all your static asset serving to another server (or a completely external CDN, which has other extremely beneficial client-side advantages too) using apache too. That is, the choice of software here isn't as big a win as presented, it's the architecture of the ecosystem that is the big influence.

Yes, I understand that. I have studied about the C10K problem[1]. And have coded another service which just uses libevent[2] directly and some C++ code to serve a feature for our site very low latency. So I understand quite well why Nginx is offering low latency.

As you rightly observe later on, I don't have the luxury to get obsessed with all the Whys, so often shoot for the major architectural gain and take any side effects that come along in the stride.

>.. But the way you've presented it doesn't indicate well that all the causes and effects are completely understood. And I think this ends up giving Apache a bad rap.

I am surprised by your this observation. I have been 100% honest in what I wrote above, and I repeat have a huge respect and thankful for the Apache team and Apache web server software. Just that, by the page loading gains we got, were clearly very good. And also there were less errors in general reported in the web master. So we stuck with the change.

Also a point regarding the switching costs and extra processing between php-fpm and Nginx processes. As I said in my first comment, we do mainly Java and PHP is just for the blog. But I very clearly remember seeing all the Apache child procs bloating to 25 Mb after the first hit to the PHP code was done. So I am actually saving by externalizing on the resources. Trust me I know what I am doing.

Another tangential thing not related to Nginx, which I am doing for low resource consumption. Is moving some relevant code from Java to Go. And there also am seeing huge memory gains (i.e. savings). Perhaps will share more about it at an appropriate time.

[1] http://www.kegel.com/c10k.html

[2] libevent.org

Edit: grammar

comment 13y ago · link · parent

Agreed. In hindsight, I am sure, we could have externalized the PHP with Apache as well. But the larger context of this move was doing more with less. And Nginx just working with 4 instances and serving just as much, with a reduced average latency of page load, justified the move.

And I sort of felt sad doing this. Because I have a huge respect for Apache. I hope just like what Chrome did to Firefox, Nginx does to Apache, and its a win-win for all.

comment 13y ago · link · parent

>Nginx has taken over some of Apache's market because it's lighter on resources, i.e. with the same amount of resources it can process & deliver more stuff.

That's precisely why we moved to Nginx. We do mostly Java so Apache was not the problem there, as it was simply proxying over to Jettys.

But the blog is wordpress that means PHP, so we had to use modphp modules with Apache. That was Okay initially, but as we scaled, we saw some 50 instances of Apache and each taking 25 Mb memory. And note, most of the bloat in memory was due to modphp being loaded in-memory in each instance.

We moved to Nginx with an external php-fpm for PHP, and just 4 Nginx instances take up the entire load and each uses some 2.5 Mb of memory.

And at the same time Google webmaster shows a significant drop in average latency.

So that's our experience of why we moved to Nginx.

Edit: typo

34.

Could VKontakte Be Edward Snowden's Next Employer?(businessweek.com ↗)

1 points · by rehack · 13y ago · discuss

comment 13y ago · link · parent

Makes me Wonder, if the Internet in this widespread form, was allowed so that they can snoop (so easily)?

When I was a kid, my father, had told me a story that in Russia people are scared to speak their minds, for fear of being snooped via any hidden gadgets in the walls.

comment 13y ago · link · parent

>The only thing I can tell you is to go and get health insurance ASAP. Both for yourself and your dependents.

I am not too sure about that. I think medical insurance hasn't yet become all pervasive in India, and thankfully so.

Insurance companies are there to make profit, and so will tend to exploit fear to maximize their profits. Leading to inflated costs, as it has happened in US.

So I am against insurance in this form, unless it works like a non-profit cooperative. In fact Dr. Devi Shetty has also innovated here, with a scheme which costs as little as Re. 5 per month (1/60 USD per month) and provides heart coverage to rural Indians. It works as a cooperative scheme of course.

I am surprised, Insurance companies, even exist. As they should be the first thing to be replaced by Software (as in 'Software eating the world' by Marc Andressen)... It should happen, will just take some time, I guess.

So, I think, India can still save itself from corporate medical insurance. As seen in some countries like Canada, a fully public health care system, works as good, if not better.

On a personal note, after having, earlier, taken medical insurance for me and family by paying some 9000/- Rs per annum and getting a cover of 300000/- Rs. I decided this year to not renew it.

But of course, I won't dare to prescribe it generally, each person must take his own decision.

Appendix: 1) http://arachnoid.com/wrong/index.html (ctrl-f 'Insurance is a wise investment')

comment 13y ago · link · parent

>In fact, here vote is mandatory, because when it wasn't, less than 5% voted at all

But voting being mandatory, is a very alarming thing. Does not sound like democracy at all. What happens, when one does not vote?

comment 13y ago · link · parent

Since we are discussing the questions. Here is one I can't forget, it was one of the tough Physics question in the year when I took JEE.

Here goes (text from my memory): There is a rolled carpet of length, L, kept on an even floor. A person gives it a gentle push, and the carpet starts to unroll. What will be the velocity of the unrolled piece of the carpet, when the carpet is half unrolled? (You can ignore the contribution of the initial push, for this computation)

PS: I will look for answers, here tomorrow ... :-)

comment 13y ago · link · parent

> As some one who is in 20's and watching people in their 40's(My uncles) and my father(in his 60's) I can tell you the only chance we engineers have is to make loads of money, real estate and savings before we are 40-45. Else we are screwed

Bull Shit. Stereotypes are just stereotypes. If you follow one you will be one. I am 41 year old engineer(programmer) & Entrepreneur. One project I am coding now has Java, C++, Go all together. The younger programmers in my team were sort of scared to touch C++ part. I am encouraging one of them to learn Go.

I do two projects at a time, one of my own and another for a client. Support the former a bit with the consulting money I get from the latter.

I wrote the above to counter your ageist myths. You are younger and I presume flexible enough to correct them :-)

PS: I didn't down vote you BTW.

40.

LibraryThing: How to succeed in an Amazon/Goodreads world(librarything.com ↗)

1 points · by rehack · 13y ago · discuss

41.

Ascii art for Go lovers(shiningleaf.wordpress.com ↗)

1 points · by rehack · 13y ago · discuss

comment 13y ago · link · parent

Hi,

  Perhaps you should post the stats, after subtracting out the bot visits, from the stats. 

  For our daily stats we do that. Also (internally) report the bot visit counts. For example yesterday we had: 

    Bot name 	No. of visits
       User-Agent=Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html),	95000*
       User-Agent=Mozilla/5.0 (compatible; bingbot/2.0; +http://www.bing.com/bingbot.htm),	700*
* - the last few digits have been rounded off

Edit: For display

43.

Shattered Genius(brettforrest.com ↗)

1 points · by rehack · 13y ago · discuss

comment 13y ago · link · parent

> "Bellard doesn’t appear to promote himself—he politely declined to be interviewed for this profile"

In my opinion, that's the key.

Getting famous, comes in the way of a lot of people, whether they are a scientist or a programmer.

Read at some place, that many popular scientists, once they do something great and get popular, just have to interact with other people so much, that they don't get the time for doing something great.

Recently, on HN, there was a 'letter of note' by some famous author of why he was going to stop replying to reader letters. As that left him no time to write another novel/story[1].

Of course, for mere mortals (who don't taste that level of famousness) there are mundane hindrances like Facebook ;-)

[1] Discussion on 'The morning mail is my enemy' http://news.ycombinator.com/item?id=4409363

Update: Added reference

comment 13y ago · link · parent

Agree. The choice of perl actually does surprise people, genuinely. As somewhere else mentioned, even blekko uses perl. So obviously these people know what they are doing.

But that said, choosing anything interpreted does come to haunt you later on, in some way or the other.

We run Java on Jettys for most of the things for our app (traffic is around 60k/70k in a day, so much less in comparison). But even with this traffic, we need to use 2 large EC2 instances in the day time. And mysteriously the Jettys keep going out of memory every now and then.*

I am sure the same thing if done in C++ would need only 1 large EC2 instance. And it will also help the latency a bit, as a parallel gain. At present am analyzing the cost/benefit of such a move. Inputs are welcome.

* With Java its always the memory which hurts you first. Latency wise, not much of a difference, in most cases.

Edit: Down vote? Surprised. Why??

comment 13y ago · link · parent

Great article. Thanks. Could you please share, the good things you did which made the direct searches jump during Jan-2012 to Mar-2012?

comment 13y ago · link · parent

Okay, I upvoted this story for the sake of 'missing kindness', in general on the Internet.

But after having understood, the whole story. What replace does is that, basically it is a good small utility for the author of the post to replace some content from a lot of files, also recursively going through directories. And the author happened to make it depend on nodejs.

In defense of these folks, who made nasty comments: they appeared to have made so, in the context of this nodeJS-based-replace, attempting to replace the sed/awk/grep and unix scripting.

To any long time unix user, any quick hack to replace the said commands, does indeed appear to be falling short. And also a bit of a why would you need to do such a thing?.

Honestly, they should have been just empathetic enough to understand a non-unix user, hacking a quick utility, with the tools she is familiar with (nodeJS and javascript) to come up with something useful for self and friends.

edit: rephrase

comment 13y ago · link · parent

>But TechCrunch is completely right to call us all out

Agree with you.

If you look at Aaron's activity on HN[1], you will see that there is none from around 144 days i.e. 15 days before from after the help submission[2] was discussed. If you see earlier activity, he had been posting things with a gap of 10-20 days. So it can't be ruled out, that perhaps he felt let down by the community. Sad.

  [1] http://news.ycombinator.com/user?id=aaronsw
  [2] http://news.ycombinator.com/item?id=4529484

comment 13y ago · link · parent

How do you know that, the 'anonymous' poster has not posted this to shame the bastard and the ex-wife?... Doubt a small (30-40 employee) tech company's employees don't spend any time on stackexchange or on HN.

And the poster has left just enough clues for his target audience (other employees and his and his ex-wife personal friends) to figure out things. At the same time he is within limits such that he is legally safe (against any defamation suits).

One can't be sure, but if this posting, indeed was a shaming strategy. I would say good solid punch. Bang on the face.

comment 13y ago · link · parent

I also use hckrnews.com, its a much better interface for HN.

Particularly its useful, if I have not used HN for some days, and come back to see 'what great items have I missed?'.

edit: minor rephrase

comment 13y ago · link · parent

I tried with "Apple hypnotized the Google founder with a magic wand, end with..." :-)

http://translate.google.com.mx/?hl=en#en/fr/Apple%20hypnotiz....

Apparently happens with all the statements suffixed with "end with"

comment 13y ago · link · parent

Yes, I think, there are various takeaways at various levels in that book. The way I understood it, at the surface level, there is the lovely story of Father and Son on a road trip.

At deeper levels a lot of things are left to the interpretation of the reader, as it is with most abstract things. He uses the word Quality in the most fundamental way. To me that word held the meaning for his life. Quality in the way in which he understands and reacts to the world.

Before he learned to fix his motor cycle, he was at the mercy of various kinds of mechanics with varying skill levels and attitudes. He particularly cites an example of some listening to music while working on the machine. Which he does not like. For him working on the machine or writing technical documents for his job, is a spiritual activity.

Also, he makes a point regarding his nervous breakdown, that for others it was a nervous breakdown. But for him, the way he saw it, it was the deepest of meditations. Following which phase the understanding and meaning of Quality, dawned on him, and he was at peace with his life.

Also, I found the way he treats his 11 year old son, i.e like an adult, very interesting.

Another delightful thing, was the book full of philosophical quotable quotes. Like the (approximate) one I have cited in my above comment.

But most basic reason I liked the book, is because, it talked to me in the tone, I wanted it to talk to me. For example the moment any book becomes very specific (for example 'Life of Pi' is very specific in being inclusive to all religions, in a rather simplistic way), as a reader I tend to start to disagree. But if it is abstract, and "Zen.." is very very abstract in portions, I can provide my own concrete implementations!

comment 13y ago · link · parent

Zen and the art of motorcycle maintenance - A book on philosophy, can go as deep as you like. Was written over 25 years ago, but feels very fresh. My key take away from this book was that you should be humble enough to appreciate various models of the world - e.g. Science or Religion. Favorite quote: "When you have a Chatuahaha in your head, you can't resist inflicting it on innocent people". Still makes me smile :-)

Life of Pi - Bought it following the buzz of the movie. Read the book first, then saw the movie. A good simple read. Sort of reinforces, the 'various models' idea of the 'Zen...' book. Found the movie slightly better than the book, which was a surprise. Ang Lee has made subtle changes, which makes the story more peppy.

Perfect Rigor - Captures the story (and math) behind, the turning down of a million dollar prize by Gregory Perelman. The genius Russian mathematician, who solved a 100 year old standing problem, of the missing proof of the Poincare Conjecture. It was perhaps my best technical read of the year.

I am feeling Lucky (by Doug Edwards): Google's emplpyee number 59, writes about his experience at Google. I found it the best book on Google. Better than some of the others, which seem a bit like officially authorized versions.

Below ones I read it in 2011. But haven't posted here, so here goes:

Born to Run (By Chris Mcdougall): A health book. Has really helped my running. Highly recommended to all.

A guide to a good life: The ancient art of Stoic Joy (By Joseph Irvine): A very good book on philosophy. Read it on the reco (http://sivers.org/book) of Derek Sivers.

comment 13y ago · link · parent

I beg to differ. I think this is an interpretation adapted to meet the requirements of modern times . Because the commonly held interpretation of the proverb, is very simply, what it means, that you got to discipline the child, by spanking[1].

IMHO, this(revised definition) is a catchup which the clergy (of various religions) play every now and then. Sometimes to meet the new discovery in science, or other times to meet the current human right guidelines.

[1] http://en.wiktionary.org/wiki/spare_the_rod_and_spoil_the_ch...

comment 13y ago · link · parent

Thanks for sharing your story, its very moving and wish the very best for you, and all your siblings.

>People say drugs like marijuana are bad, alcohol is the worse of them all

Totally agree. I have seen, my close friend (from college) totally disintegrate because of alcohol abuse. He did a lot of very nasty things to the persons he loved. Lost his job (several times). Got a job after a long time with difficulty and then lost it again. It became so bad, that he became delirious, and started hallucinating about some people being present when he was alone. And being the raw and powerful person he is, its very difficult for anybody to help him, unless he himself cooperates.

After seeing him at close quarters, and trying to be of help, I can say that alcohol abuse is the worst kind of evil. Now a days, in India, they show a lot of mandatory ugly-cigarette warnings before showing a movie. Every time I see those, I am reminded, that there can be none worse than alcohol abuse. Cigarette smoking is known to cause cancer, and is bad. But alcohol abuse is like cancer of the mind. Where the person himself/herself becomes a cancer for their close family.

comment 13y ago · link · parent

Sorry, I did not like this one.

I respect Derek Sivers a lot, for a lot of things. But I honestly think, this one lacks the punch of some of his other (earlier) writings. For example, he was at his insightful best in 'ideas are just a multiplier of execution'. When I read that, I was blown away, "what clarity!" I thought. And it seemed like a genuine outpouring of a Doer.

But this one is ambivalence at its peak. Sort of Chicken-soupish. It lacks the balance, and is a bit extremist. Any very unlike the writings of a stoical mind (And please-please, I am not pulling any punches at all. I hold Derek Sivers, in high esteem. But even gurus, need some candid feedback at times), which I am sure he is, most of the times.

comment 14y ago · link · parent

I think OP's post treats swap along the conventional lines i.e swap is good. I think its true for applications running on the client machine. Where you don't want an app, say Eclipse, to crash for lack of memory. And for some years that conventional wisdom stayed on the server side as well.

But modern wisdom on that is that, in general(+), it may be good to not have swap at all, on your server. Rather than address things by running parallel instances and load balancing.

As such swap space may also run out eventually if some service is leaking memory. And until it does it will make the system slow for everybody. Its better instead to let the culprit processes simply die, and make things easier for every body else.

On my server my jettys keep dying when they run out of memory. Thankfully there are lot other instances which are there to process requests.

Its a trade off you make, in favor of dropping some requests which are currently hitting the errant service (jetty instance in my case) vs. slowing down things for everybody, to the extent that even the developers can't help until something finally runs out of swap space also and dies (like the solr case you and OP mentions).

+ I say in general because there definitely could be reasons when you need swap.

Edit: Added explanation for (+)

comment 14y ago · link · parent

Perhaps you could also have a text submit page (form), and then allow people to download the generated pdf? (Allows people to try out anonymously)

Also, generating in some kind of editable format, may be a good idea. For any minor edits I want to do, on the generated invoice, or fix any errors in generation because of its interpretation of the text.

comment 14y ago · link · parent

I got to mention that reading your comment, had me in splits, at 2 or 3 places ... "Oh, you don't have a degree? We won't hire you. Oh, but you do make your own beer and wear funny shoes? Cultural fit! Hired!" :-) ... "Startup is Mother. Startup is Father." How do you think that one? :-) :-)

comment 14y ago · link · parent

Agree with you. Otherwise, it was totally puzzling to me a simplistic, judgmental view calling him a jerk as a top comment.

Don't know how many people have been married a long time here (i.e. > 10 years). Looking at the responses, it seems to me not that many.

Thankfully, my marriage is several orders better than his was. But still I can perhaps see where the conditions are coming from.

Just to take an example - C(3) - you will leave my bedroom or study immediately without protest if I request it.

I can see that for whatever reasons any fights between a husband (who works from home) and wife start when the husband is nicely all set to begin the day's work. It may be over a trivia discussion (perhaps because the husband has some work related frustration) or it could be the result of something building up. Now as a husband who is working from home, does not even have the choice to go to work elsewhere, in such a situation. And the argument/discussion/fight won't end until one person leaves the place. And countless hours can get lost, for a trivia thing.

12345