Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [geomesa-users] Ingestion speed

Mario,

To add a little more to what Emilo has mentioned there are a few accumulo considerations that control ingest.

Write Ahead Logs (WAL) are a large factor in limiting ingest. With WALs on, the data must be sync'd to disk as well as placed in an in memory buffer before being minor compacted to disk. Each sync to disk (usually an hsync by hadoop which causes an underlying filesystem fsync) is very expensive. Thus, minimizing these costs are important. As Emilio mentioned make sure to enable native memory maps with "tserver.memory.maps.native.enabled" (which is the default in 1.6)

They key to ingest is getting enough clients writing data, have enough network to handle it, and have enough memory on the tservers to handle lots of ingest.

On the tserver you can play with:
1. increasing the in memory buffer...This parameter is "tserver.memory.maps.max" and requires a tserver restart
2. increasing the number of WALS associated with a tablet...this parameter is table.compaction.minor.logs.threshold but is only important if you are seeing this as the reason for minc in the logs. It's OK to increase it to like 5-6 it just makes recovery slower. On a long running ingest if you see spikes that take the rate almost down to zero that's generally what is happening. It gets worse as the number of tablets increases.
3. increase the queue of mutations to sync to the WALS: tserver.mutation.queue.max

If you have lots of waiting minor or major compactions on individual tservers (noted in parenthesis in the monitor):
4. increase tserver.compaction.major.concurrent.max
5. increase tserver.compaction.minor.concurrent.max

When increasing all of these parameters you must note that the server load can increase in terms of CPU, memory, and network bandwidth at the expense of query if your boxes aren't large. In terms of memory, give accumulo lots...regularly we run with 30-40 gigs. For hadoop use 2.4 or higher, install native libraries for hadoop, and enable short circuiting.

The goal of quick ingest is to fill up the in memory buffers as fast as we can and then compact them out and to do this on every tserver. Some stats for a 20 node Amazon cluster with network-mounted disk and WAL on: averages ~250k simple features (with 22 attributes each) per second which means when you throw an index in you'll end up getter 1M entries/s which 50k per node. If you want to head higher than that you'll have to consider using Accumulo Bulk Ingest which requires building rfiles with some process such as MapReduce, Storm, NiFi, or other framework and then loading them directly into accumulo. Generally you're getting to a much larger cluster before you need to do things like that. I like to set my BatchWriter mem higher with low latencies and make lots of batch writers.

Lastly, note that ingesting streams of data in time order is slow than a map-reduce approach with batchwriters.

I'll run an ingest at some point with some smaller features around 7-8 attrs and let you know what the rate was.

Andrew

On 11/12/2015 12:25 PM, Emilio Lahr-Vivaz wrote:
Hi Mario,

10k records/s seems reasonable. We were just doing some single-threaded ingestion (without any optimizations) on a 10-node cluster and were seeing speeds of about 14k/s. That includes parsing data off disk, of course. Distributing the ingestion over map/reduce we got about 50k/s. This was all just using geotools feature writers.

That said, there are a lot of things you could do to improve ingest performance:

* If the ID field is unique, then you can use it as the simple feature ID instead, and then you don't need to store or index it as a separate attribute. That will decrease the amount of data written and speed up your ingest. You can still query for ID by using CQL: IN('myid').  Also, if the feature ID is not set, we generate a semi-random UUID, which can be (relatively) slow.

* Depending on your query requirements, you can turn off the writing of various indices. Note that this may make certain queries much slower. You can do this by setting the user data in your simple feature type before calling createSchema:
	"table.indexes.enabled" -> "records,z3"

* Tweaking the accumulo batch writer buffer size. Buffering more entries in memory usually increases throughput, at the expense of heap space. You can control the batch writer settings through system properties:
	"geomesa.batchwriter.latency.millis"
	"geomesa.batchwriter.memory" // Measured in bytes
	"geomesa.batchwriter.maxthreads"
	"geomesa.batchwriter.timeout.millis"

* Aggressive pre-splitting of tables in accumulo
GeoMesa adds some splits on table creation, but if you know your data distribution and size (or can extrapolate it), adding splits to the table will result in data being written across different tservers, which will increase write speeds.

* Ensuring accumulo is using native memory maps instead of java maps

* Turning off the accumulo write-ahead-logs - this usually speeds things up a lot, at the expense of losing data in the case of a crash.

If you're using map/reduce, you might also try out the GeoMesaOutputFormat - it delegates to the AccumuloOutputFormat. Although we haven't implemented it for GeoMesa, using the AccumuloFileOutputFormat and bulk importing the resulting files is generally the fastest way to get data into accumulo.

Hope that helps. If you try any of this, please circle back and let us know the outcome. Also, pull requests are always appreciated :)

Thanks,

Emilio

On Thu, 2015-11-12 at 17:09 +0100, Mario Pastorelli wrote:
Hello,

I'm testing GeoMesa for our data and I noticed that the maximum speed achievable in my tests is around 10k records/second. I have 4 servers and this means 40k records/second which is low for the kind of data that I have to ingest. I can't find good benchmarks of GeoMesa so I was wondering if 10k/s per server is what to be expected from GeoMesa.
The data is straightforward: it has a date (time-index), a location (space-index), an id (index=true) and seven other fields that shouldn't be indexed. The data is read from hdfs and written using GeoMesa library without any other logic.

Thanks,
Mario Pastorelli

_______________________________________________
geomesa-users mailing list
geomesa-users@xxxxxxxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
http://www.locationtech.org/mailman/listinfo/geomesa-users


_______________________________________________
geomesa-users mailing list
geomesa-users@xxxxxxxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
http://www.locationtech.org/mailman/listinfo/geomesa-users


Back to the top