Ashish,

I had similar experiences with our data.  You do have to explicitly turn on
compression for importtsv, it doesn't pick up the config for the family
automatically.  If you don't do that, then you have to wait for
major_compaction to go through an compress everything.

For inporttsv, you can use command line options like:

>  -Dhfile.compression=gz -Dhfile.compress.output=true
>
Which is for GZIP compression, but if you have the LZO codec installed, you
should be able to change it to "lzo".  I haven't tried this yet.  The
"hfile.compress.output" setting may not be necessary, as specifying
"hfile.compression" alone might be sufficient.

We also have large, immutable data loads in big batches.  For new tables, it
was important to pre-split the regions.  I wound up running the first job
and then sampling the output keys to get 200 to 300 keys in order.  Only
have to do this once for a new table.  I also found it helpful to run major
compaction right after a bulk load (since the keys for the initial
partitions were only sampled, this helps smooth it out.

As a performance data point, for about 12gb (uncompressed), 39 M records, on
a table that had 1,405 regions; our load throughput was around 40k rows /
second.  This is an 11 node cluster (8 core).  With only 300 regions (when
the table was initially empty), we achieved 200k rows / second.  It seems to
me that the loads go faster when there are fewer regions (as long as there
are not too few, causing split-churn); so, as Stack suggested, it might make
sense to increase the hfile size to 1 GB.

Marc


On Fri, Jan 21, 2011 at 10:17 PM, Ashish Shinde <[email protected]> wrote:

> Yes I did try LZO compression it helped, however the resultant disk
> usage was on par with uncompressed text size.
>
> Writing out our serialized data records as batches as a single row with
> a single column and LZO compression enabled resulted in the data
> getting compressed to 25-30% of original size.
>
> The impressive thing was that with the above approach the number of
> rows on our test data reduced from 12 million to 12 K. However the
> insert times were very similar again indicating that hbase inserts
> times are sort of irrespective of the current table size.
>
> On a side note I needed to run major_compaction to get the data
> compressed. Bulk upload did not write out data compressed.
>
> Am I missing something?
>
> Thanks and regards,
>  - Ashish
>
>
>  On Thu, 20 Jan 2011 21:23:03 -0800
> Ted Dunning <[email protected]> wrote:
>
> > Were you using LZO?  Repetitive keys should compress almost to
> > nothing.
> >
> > On Thu, Jan 20, 2011 at 8:48 PM, Ashish Shinde <[email protected]>
> > wrote:
> >
> > > Hi Stack,
> > >
> > > Yes makes sense. Will approach it from our needs perspective.
> > >
> > > I tried using a prebaked table and a reasonable partioner with very
> > >  promising results in terms of insert times.
> > >
> > > However the size of a 1.6 GB test file after import resulted in a
> > > hbase folder roughly 6 GB. Although in most cases people are not
> > > disk size sensitive, we would really like to keep disk usage at a
> > > minimum.
> > >
> > > The nature of the data required me to create a rowkey that was 100
> > > bytes long. An examination of the table's datablock's revealed that
> > > every column in the datablock is proceeded by the rowkey, and in our
> > > case this results an overhead of 6 times. Am I doing something
> > > obviously wrong?
> > >
> > > Serializing the row into a single hbase column brought the disk
> > > usage under wraps. Another approach I tried was to club a number of
> > > rows into a single hbase row and used a different indexing scheme
> > > with a simple long rowkey. This provided the best performance and
> > > the used the least amount of disk space.
> > >
> > > Our data is immutable at least as much as I can for see. Is the
> > > serialized row the best option I have? Does the number of rows in a
> > > table affect read performance. If this is the case then clubbing
> > > rows seems the be a reasonable option.
> > >
> > > Thanks and regards,
> > >  - Ashish
> > >
> > >
> > > On Wed, 19 Jan 2011 22:16:33 -0800
> > > Stack <[email protected]> wrote:
> > >
> > > > On Wed, Jan 19, 2011 at 9:50 PM, Ashish Shinde
> > > > <[email protected]> wrote:
> > > > > I have to say I am might impressed with hadoop and hbase, the
> > > > > overall philosophy and the architecture and have decided to
> > > > > contribute as much as time permits. Already looking at the
> > > > > "noob" issues on hbase jira :)
> > > > >
> > > >
> > > > I'd say work on your particular need rather than on noob issues.
> > > > Thats probably the best contrib. you could make.  Figure out the
> > > > blockers -- we'll help out -- that get in the way of your sizeable
> > > > incremental bulk uploads.  Your use case makes for a good story.
> > > >
> > > > Good luck Ashish,
> > > > St.Ack
> > >
> > >
>
>

Reply via email to