You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@kafka.apache.org by "Datta, Saurav" <sd...@paypal.com.INVALID> on 2015/08/12 21:27:30 UTC

Sending multiple large HDFS files through Kafka

Hello,

I am trying to publish multiple large HDFS files to Kafka.
While it is possible to loop through the lines of each file and publish to Kafka, it will be very inefficient.
Any suggestions for achieving this optimally ?

Regards,
Saurav

Re: Sending multiple large HDFS files through Kafka

Posted by Hawin Jiang <ha...@gmail.com>.
Hi  Saurav

I think you can try to put your messages to one file and send it to
producer.
Maybe you will receive a good TPS.



Best regards
Hawin

On Wed, Aug 12, 2015 at 2:35 PM, Datta, Saurav <sd...@paypal.com.invalid>
wrote:

> Thank you for your suggestion Jeff. For my case, the size of each record
> in the files will not exceed 10KB.
>
> Given this, what is the best way to send the HDFS files to the producer ?
> One option is to write a mapper and call producer.send() for each line.
>
> Regards,
> Saurav
>
>
> -----Original Message-----
> From: Jeff Holoman <jh...@cloudera.com>
> Reply-To: "users@kafka.apache.org" <us...@kafka.apache.org>
> Date: Wednesday, August 12, 2015 at 12:46 PM
> To: "users@kafka.apache.org" <us...@kafka.apache.org>
> Subject: Re: Sending multiple large HDFS files through Kafka
>
> >Kafka isn't really designed for large file transfers. In my testing the
> >throughput and efficiency decreases pretty dramatically after 10k message
> >size.
> >
> >Gwen has a nice blog on this
> >
> >http://ingest.tips/2015/01/21/handling-large-messages-kafka/
> >
> >Thanks
> >
> >Jeff
> >
> >On Wed, Aug 12, 2015 at 3:27 PM, Datta, Saurav <sdatta@paypal.com.invalid
> >
> >wrote:
> >
> >> Hello,
> >>
> >> I am trying to publish multiple large HDFS files to Kafka.
> >> While it is possible to loop through the lines of each file and publish
> >>to
> >> Kafka, it will be very inefficient.
> >> Any suggestions for achieving this optimally ?
> >>
> >> Regards,
> >> Saurav
> >>
> >
> >
> >
> >--
> >Jeff Holoman
> >Systems Engineer
>
>

Re: Sending multiple large HDFS files through Kafka

Posted by "Datta, Saurav" <sd...@paypal.com.INVALID>.
Thanks for the input Gwen. Will try it out and share the stats.


Regards,
Saurav 


-----Original Message-----
From: Gwen Shapira <gw...@confluent.io>
Reply-To: "users@kafka.apache.org" <us...@kafka.apache.org>
Date: Wednesday, August 12, 2015 at 10:44 PM
To: "users@kafka.apache.org" <us...@kafka.apache.org>
Subject: Re: Sending multiple large HDFS files through Kafka

>Yeah, that should be very scalable since you get a mapper for each block
>and tons of parallel writes to Kafka.
>You can also do something similar in Spark.
>
>Will be interesting to hear what was the throughput you got (i.e how many
>mappers and how many bytes/sec total).
>
>On Wed, Aug 12, 2015 at 2:35 PM, Datta, Saurav <sd...@paypal.com.invalid>
>wrote:
>
>> Thank you for your suggestion Jeff. For my case, the size of each record
>> in the files will not exceed 10KB.
>>
>> Given this, what is the best way to send the HDFS files to the producer
>>?
>> One option is to write a mapper and call producer.send() for each line.
>>
>> Regards,
>> Saurav
>>
>>
>> -----Original Message-----
>> From: Jeff Holoman <jh...@cloudera.com>
>> Reply-To: "users@kafka.apache.org" <us...@kafka.apache.org>
>> Date: Wednesday, August 12, 2015 at 12:46 PM
>> To: "users@kafka.apache.org" <us...@kafka.apache.org>
>> Subject: Re: Sending multiple large HDFS files through Kafka
>>
>> >Kafka isn't really designed for large file transfers. In my testing the
>> >throughput and efficiency decreases pretty dramatically after 10k
>>message
>> >size.
>> >
>> >Gwen has a nice blog on this
>> >
>> >http://ingest.tips/2015/01/21/handling-large-messages-kafka/
>> >
>> >Thanks
>> >
>> >Jeff
>> >
>> >On Wed, Aug 12, 2015 at 3:27 PM, Datta, Saurav
>><sdatta@paypal.com.invalid
>> >
>> >wrote:
>> >
>> >> Hello,
>> >>
>> >> I am trying to publish multiple large HDFS files to Kafka.
>> >> While it is possible to loop through the lines of each file and
>>publish
>> >>to
>> >> Kafka, it will be very inefficient.
>> >> Any suggestions for achieving this optimally ?
>> >>
>> >> Regards,
>> >> Saurav
>> >>
>> >
>> >
>> >
>> >--
>> >Jeff Holoman
>> >Systems Engineer
>>
>>


Re: Sending multiple large HDFS files through Kafka

Posted by Gwen Shapira <gw...@confluent.io>.
Yeah, that should be very scalable since you get a mapper for each block
and tons of parallel writes to Kafka.
You can also do something similar in Spark.

Will be interesting to hear what was the throughput you got (i.e how many
mappers and how many bytes/sec total).

On Wed, Aug 12, 2015 at 2:35 PM, Datta, Saurav <sd...@paypal.com.invalid>
wrote:

> Thank you for your suggestion Jeff. For my case, the size of each record
> in the files will not exceed 10KB.
>
> Given this, what is the best way to send the HDFS files to the producer ?
> One option is to write a mapper and call producer.send() for each line.
>
> Regards,
> Saurav
>
>
> -----Original Message-----
> From: Jeff Holoman <jh...@cloudera.com>
> Reply-To: "users@kafka.apache.org" <us...@kafka.apache.org>
> Date: Wednesday, August 12, 2015 at 12:46 PM
> To: "users@kafka.apache.org" <us...@kafka.apache.org>
> Subject: Re: Sending multiple large HDFS files through Kafka
>
> >Kafka isn't really designed for large file transfers. In my testing the
> >throughput and efficiency decreases pretty dramatically after 10k message
> >size.
> >
> >Gwen has a nice blog on this
> >
> >http://ingest.tips/2015/01/21/handling-large-messages-kafka/
> >
> >Thanks
> >
> >Jeff
> >
> >On Wed, Aug 12, 2015 at 3:27 PM, Datta, Saurav <sdatta@paypal.com.invalid
> >
> >wrote:
> >
> >> Hello,
> >>
> >> I am trying to publish multiple large HDFS files to Kafka.
> >> While it is possible to loop through the lines of each file and publish
> >>to
> >> Kafka, it will be very inefficient.
> >> Any suggestions for achieving this optimally ?
> >>
> >> Regards,
> >> Saurav
> >>
> >
> >
> >
> >--
> >Jeff Holoman
> >Systems Engineer
>
>

Re: Sending multiple large HDFS files through Kafka

Posted by "Datta, Saurav" <sd...@paypal.com.INVALID>.
Thank you for your suggestion Jeff. For my case, the size of each record
in the files will not exceed 10KB.

Given this, what is the best way to send the HDFS files to the producer ?
One option is to write a mapper and call producer.send() for each line.

Regards,
Saurav 


-----Original Message-----
From: Jeff Holoman <jh...@cloudera.com>
Reply-To: "users@kafka.apache.org" <us...@kafka.apache.org>
Date: Wednesday, August 12, 2015 at 12:46 PM
To: "users@kafka.apache.org" <us...@kafka.apache.org>
Subject: Re: Sending multiple large HDFS files through Kafka

>Kafka isn't really designed for large file transfers. In my testing the
>throughput and efficiency decreases pretty dramatically after 10k message
>size.
>
>Gwen has a nice blog on this
>
>http://ingest.tips/2015/01/21/handling-large-messages-kafka/
>
>Thanks
>
>Jeff
>
>On Wed, Aug 12, 2015 at 3:27 PM, Datta, Saurav <sd...@paypal.com.invalid>
>wrote:
>
>> Hello,
>>
>> I am trying to publish multiple large HDFS files to Kafka.
>> While it is possible to loop through the lines of each file and publish
>>to
>> Kafka, it will be very inefficient.
>> Any suggestions for achieving this optimally ?
>>
>> Regards,
>> Saurav
>>
>
>
>
>-- 
>Jeff Holoman
>Systems Engineer


Re: Sending multiple large HDFS files through Kafka

Posted by Jeff Holoman <jh...@cloudera.com>.
Kafka isn't really designed for large file transfers. In my testing the
throughput and efficiency decreases pretty dramatically after 10k message
size.

Gwen has a nice blog on this

http://ingest.tips/2015/01/21/handling-large-messages-kafka/

Thanks

Jeff

On Wed, Aug 12, 2015 at 3:27 PM, Datta, Saurav <sd...@paypal.com.invalid>
wrote:

> Hello,
>
> I am trying to publish multiple large HDFS files to Kafka.
> While it is possible to loop through the lines of each file and publish to
> Kafka, it will be very inefficient.
> Any suggestions for achieving this optimally ?
>
> Regards,
> Saurav
>



-- 
Jeff Holoman
Systems Engineer