Live data from Hacker News

How to speed up massive data analysis by eliminating disk seeks

petewarden.typepad.com

21–28 of 28 posts

Re: How to speed up massive data analysis by eliminating disk seeks

#22
it is a good point that classical dbms's aren't always good, however the method that a dbms uses to perform queries are always good to know. the author here implemented a sort-merge-join which is one of the classic implementations of join algorithm. for a good overview of the trade offs between various the various join and sort algorithms see "Principles of Database & Knowledge-Base Systems Vol. 2" by Jeff Ullman. The first chapter in the book is the one you want. It is dated but therefore cheap if you get it used.

here is the worldcat link http://www.worldcat.org/oclc/439156325

Re: How to speed up massive data analysis by eliminating disk seeks

#24

Where do you store the processed data for recall? It seems you have data per fan page as well as a google style suggest index of those page names.

I'm actually storing out the data as text files containing json in the file system, one per fan page. I normally use Mongo, Redis, Tokyo or MySQL for this sort of thing, but since I'd already done all of the processing that they normally help me with as operations on disk files, I thought I'd try sticking with the low-tech theme.

Re: How to speed up massive data analysis by eliminating disk seeks

#25
post #22

it is a good point that classical dbms's aren't always good, however the method that a dbms uses to perform queries are always good to know. the author here implemented a sort-merge-join which is one of the classic implementations of join algorithm. for a good overview of the trade offs between various the various join and sort algorithms see "Principles of Database & Knowledge-Base Systems Vol. 2" by Jeff Ullman. Th…

Cheers! That's exactly the sort of reference I was hoping for.

Re: How to speed up massive data analysis by eliminating disk seeks

#26
Yes, you are reinventing the wheel. This kind of approach has been used for decades in disk drive controllers. You sort track accesses in ascending or descending order to prevent longer seeks. It's called the "elevator algorithm".

http://en.wikipedia.org/wiki/Elevator_algorithm

This is combined with tag queuing, where multiple requests can be accepted from the host at once. The greater your tag depth, the more insight the controller gets into future seeks.

Re: How to speed up massive data analysis by eliminating disk seeks

#27

Yes, you are reinventing the wheel. This kind of approach has been used for decades in disk drive controllers. You sort track accesses in ascending or descending order to prevent longer seeks. It's called the "elevator algorithm". http://en.wikipedia.org/wiki/Elevator_algorithm This is combined with tag queuing, where multiple requests can be accepted from the host at once. The greater your tag depth, the more insigh…

Interesting - so in those terms I'm creating a massively deep queue of access requests, and then sorting them into an optimal order.

Re: How to speed up massive data analysis by eliminating disk seeks

#28
Take this post with a grain of salt, since I have the zeal of a recently saved sinner, but you should try using Hive and Hadoop for this sort of thing.

We recently switched from a workflow that is very similar to the one you describe to using Hive with Amazon's elastic map reduce. Hive presents a SQL-like layer of abstraction over exactly this sort of thing. Instead of doing the sorting and merging by hand, you simply write it as a series of joins. It's like writing SQL, except the actual implementation works almost exactly like what you're doing.

Integrating simple Ruby scripts for JSON processing was also trivial.

Elastic MapReduce also had near-zero infrastructure and management overhead for us (besides the 10% Amazon charges for the machine instances). We use S3 for all data input and output, which is perfect for us.

Even when running on a single machine, using Hive was a big win in terms of development time, and performance of the jobs seemed only slightly slower that using Unix utilities on big text files. It's almost a bonus that we can also scale it out to dozens of machines, for a huge speedup. Running a job that took several hours on a single machine took less than five minutes, and only a few hours of EC2 machine time. Cheap and easy!

Post reply on HN