Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
BuckToBid
searching Neon…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
7 ms
·
1.
▲
by
BuckToBid
16y ago
I just had an submission hit the front page the other day where I explained how moving from PHP/Apache to C saved my bacon. I'm 26 and have not been out of school that long. I would look for schools who start their students in C or even C+
2.
▲
by
BuckToBid
16y ago
So now you have just jumped straight into calling me a crook. I'm sorry that Wavee or whatever site you went to took your money. I honestly didn't know (and still don't) if you can make any money doing an honest penny auction site. We are
3.
▲
by
BuckToBid
16y ago
This is interesting. Would this work if I was on the site for say an hour? Or is there some limit to the amount of time you can send data like this? I have never tried anything like this. What is the overhead like?
4.
▲
by
BuckToBid
16y ago
Yes there are many penny auction sites out there. The whole reason to link it to facebook is so that you know its a real person you are bidding against. How do you know wavee has all real people bidding? You don't some of their users cou
5.
▲
by
BuckToBid
16y ago
http://en.wikipedia.org/wiki/Fork_bomb Fork Bombs are easier to pull off from the command line. Not so much with DOS. I would say that loading a large webserver for each request would use up more resources than a tiny C program. Thats
6.
▲
by
BuckToBid
16y ago
I had never heard of those before. Are they capable of working inside any web broswer? Looking it up right now.
7.
▲
by
BuckToBid
16y ago
Thanks for the suggestion!
8.
▲
by
BuckToBid
16y ago
Yes, right now its all on one server. The parts of the app that serve the pages you see are separate from the 1 second updater and could be on separate servers. Right now the C app listens on a different port that lighttpd will redirect to
9.
▲
by
BuckToBid
16y ago
Mostly just because I've never used FastCGI before, and I have played around with making C/C++ servers for fun before. Seemed like the fastest solution and so far its worked out better than expected.
10.
▲
by
BuckToBid
16y ago
Was it an auction site as well? If so which one if you don't mind me asking?
11.
▲
by
BuckToBid
16y ago
Yes, it would handle it and we could have kept scaling the server up to handle more and more of it. With the C app all those problems went away. It has almost no footprint and uses almost no processor power.
12.
▲
by
BuckToBid
16y ago
The reason it has to continually sync is that any user could place a bid at any moment. This makes the timer increase and top bidder change, so every user must be notified of the change. Its asking the server for how much time is left in
13.
▲
by
BuckToBid
16y ago
yes, I was just saying that we can't wait for replication, when someone places a bid all the others users must have that information immediately.
14.
▲
by
BuckToBid
16y ago
The timers are all set differently, we can have 9 seperate auctions going at once and all have different times they end at. Also when someone bids the timers increase. So they are not only all different but all changing constantly. Its n
15.
▲
by
BuckToBid
16y ago
I completely bypassed apache all together. Apache is not used for the 1 second ajax call at all. The only libs i used were jansson for easy json manipulation and mysql++ for database access
16.
▲
by
BuckToBid
16y ago
Thanks! I understand your point, but a fork server is so simple I don't think there is much that can go wrong there, if it was serving more data I would be worried, but its meant to do a quick and short reply.
17.
▲
by
BuckToBid
16y ago
Yeah I have run into some of those problems already. Thanks for pointing that out. You definately need a SIGALRM handler if you are thinking of doing something like this. But I don't really see how switching to Memcached is going to prev
18.
▲
by
BuckToBid
16y ago
Also because of the need for consistency and latency I'm not sure memcached would be a benefit because it could never be scaled anything but vertically anyways.
19.
▲
by
BuckToBid
16y ago
On the frontend I was already using lighttpd, but I could have used memcached on the backend that was going to be the next step if the c app didn't work. It just worked so well I didn't have to worry about it.
20.
▲
by
BuckToBid
16y ago
You could google how to do a simple fork server in c/c++ and after you have that working you just need to do something like this: stringstream response; response << "HTTP/1.1 200 OK\r\n" << "Server: BTB Auction Update
21.
▲
by
BuckToBid
16y ago
Sure thing, what part are you stuck on?
22.
▲
Moving from PHP to C saved my web startup.
61 points
by
BuckToBid
16y ago
|
83 comments