Live data from Hacker News

Website hosted on a 24 year old Linux server

raq.serialport.org

121–130 of 131 posts

Re: Website hosted on a 24 year old Linux server

#121

I remember how magical and mysterious a view counter used to feel when I was a kid. How did the website know when someone visited it? Where was the count stored? And how on earth could a website update its own HTML to show the new count? Geocities days were magical. I wonder if kids today have similar thoughts about Twitter profiles and such. It’s probably much easier to pick up the knowledge — back then, it was balk…

Similar to how the upcoming WAL2 works in SQLite, could do it atomically or "concurrent safe" like:

- Main count file.

- 2 "Append" files.

======

- Append 'a' to append file 1.

- After some time, swap append file 1 with 2.

- Count up 'a' in non-active append file 1, add it to main count.

Then just repeat, swapping append files.

Re: Website hosted on a 24 year old Linux server

#122
post #12

Oh man, this brought back memories. I used to work on Cobalt web servers, I had a stack of them at home after they eventually ended up decommissioned and these were the basis (along with some Sun pizza boxes) for most of my home lab projects for many years.

same here. I had a raq3 for a little while and a Cobalt Qube (2? I think? it was a MIPS unit) and they were a lot of fun. I was sad when Sun bought up Cobalt, though. the units were discontinued soon after.

Re: Website hosted on a 24 year old Linux server

#124

Earlier quoted context omitted.

> Doing this in modern times would be so complicated. No, it wouldn't. All you need to store this kind of data is a simple file. Most people would probably use PHP for something like that due to its ubiquity, but it could even be a few lines of bash, or Python, or Go, or whatever...

> All you need to store this kind of data is a simple file. You mostly likely need a WAL Mode SQLite database. Most of the time, it's way simpler that handling state handling in concurrent situations yourself. (also, bindings are often available - if not outright bundled by default - under most common languages) The "easy" way is all fun and games until your file is accessed in a concurrent fashion, and then your opt…

I think you mean journal mode off. Synchronous off is nothing to do with concurrency.

Re: Website hosted on a 24 year old Linux server

#125
post #34

Earlier quoted context omitted.

Yes, around that time (circa 1999) there was the matchbox web server ar Stanford with much lower capabilities (as hardware): https://web.archive.org/web/19991128033948/http://wearables.... >The Matchbox Webserver, which is serving this and the other web pages to you, is a single-board AMD 486-SX computer with a 66 MHz CPU, 16 MB RAM, and 16 MB flash ROM, big enough to hold a useful amount of RedHat 5.2 Linux includin…

Thanks for posting this, I thought it was long gone and forgotten. That server at one time was kept live on the Internet, and I showed that back in the day during a talk to demonstrate Linux capabilities. The page however says it was created in 1999, while I seem to recall it was about one year before, but the server is that one without doubt: I could never forget that photo showing it side by side with the matchbox.

Yes, first version was 1998, and was upgraded in 1999:

https://aruntechgeek.wordpress.com/2008/08/30/worlds-smalles...

AFAICR it stayed online several years.

It is to be noted how the project belonged to the "wearable" laboratory/section.

The related paper (it is a postcript inside a .gz archive) is still available:

http://boole.stanford.edu/iswc.ps.gz

here it is in .pdf format:

https://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.18...

In 2000 Sergei Brin used it in a talk as an example of what could be done with mobile devices:

https://www.wired.com/2014/05/brin-mobile-2000/

Re: Website hosted on a 24 year old Linux server

#126
post #125

Earlier quoted context omitted.

Thanks for posting this, I thought it was long gone and forgotten. That server at one time was kept live on the Internet, and I showed that back in the day during a talk to demonstrate Linux capabilities. The page however says it was created in 1999, while I seem to recall it was about one year before, but the server is that one without doubt: I could never forget that photo showing it side by side with the matchbox.

Yes, first version was 1998, and was upgraded in 1999: https://aruntechgeek.wordpress.com/2008/08/30/worlds-smalles... AFAICR it stayed online several years. It is to be noted how the project belonged to the "wearable" laboratory/section. The related paper (it is a postcript inside a .gz archive) is still available: http://boole.stanford.edu/iswc.ps.gz here it is in .pdf format: https://citeseerx.ist.psu.edu/viewdoc/…

Old GV opened both fine (even the gzipped PS).

Re: Website hosted on a 24 year old Linux server

#127

24 years is not actually THAT old... The cpu (AMD K6-2 300 MHz) is a lot faster than a raspberry pi 1 for many things, it has 512mb of ram, so for running a simple webpage, it should still work good enough. edit: especially with cloudflare infront of it...

+1

the og pi is still fairly capable, and you can achieve a lot with it if you offload a lot of things or write more efficient systems.

Re: Website hosted on a 24 year old Linux server

#128

Earlier quoted context omitted.

It can be much simpler if you're willing to write a couple lines of assembler: use an 8-byte file that contains one 64-bit counter, mmap() it, mlock() it, and use atomic CPU instructions to increment and read it.

I am going to ask gpt 4 to implement this for me so I can see what it looks like. Amazing.

How did it go?

Re: Website hosted on a 24 year old Linux server

#129
post #23

This is a great video covering the story on the company, who build this server and an early example of using Linux for web hosting! https://www.youtube.com/watch?v=PJ6AvtV3Ya4

Thanks for mentioning, that is our video and this raq talked about here is one we restored :)

I remember the Cobalt Cube. It was used for one of the first public demonstrations of SELinux released by the NSA. They gave everyone on the internet root that was under a restrictive MLS policy. That little machine handled a large number of people ssh'ing into it none of whom believed they were really logged in as root. I regret never buying one of those little servers.

Re: Website hosted on a 24 year old Linux server

#130
post #91

Earlier quoted context omitted.

It can be much simpler if you're willing to write a couple lines of assembler: use an 8-byte file that contains one 64-bit counter, mmap() it, mlock() it, and use atomic CPU instructions to increment and read it.

Genuine question: Does it have to be mlocked for this to work?

Great question: it does not! It just removes a potential source of stalls.

If the page isn't resident in the page cache, the thread(s) executing the atomic increment will take a page fault and be blocked until the file data is read from storage. The latency of the fault might be significant, but the counter will remain accurate.

There's an important caveat I should have added: the counter file might be very stale after a power failure. If you care about the counter integrity, you have to msync(MS_SYNC) periodically, and that's expensive. It might actually stall all threads interacting with the page, depending on the filesystem; that used to be true but I'm not certain it still is (see https://lwn.net/Articles/486311/). Where writeback is allowed to race with writes, whether you would be guaranteed the 8-byte value written back wasn't "torn" without explicitly blocking increments while syncing is also an interesting question if DMA is involved...

Post reply on HN