Design, how to utilize The Hardware (multiple threads and/or GPU) while indexing (via a database) a very large set of binary files

Problem

  1. How can design my file parser to maximize the hardware when processing (creating meta data for) a large file

(i.e. how to avoid being blocked by IO and running out of memory)

preferably I would like to give the user a “high priority” (locks the system apart from some progress UI) and a “run in background” option (Allows the user to start using data that has already been indexed/loaded)

Assumptions

  1. Presumably I will have no problems having multiple threads reading the same set of files?
  2. The way I see it the biggest bottleneck / will be writing to the database. Presumably I will have to lock/unlock that and have each thread queue up data to write in batches?
  3. As each thread will need its own data queues I am unsure how to make sure the machine does not run out of memory
  4. When processing the data blocks I basically want to get stuff like averages, minimums and maximums, I have assumed I can’t use the GPU to process the data blocks like this? it feels like there is too much shared data to utilize the GPU here.

Detail:

I am working with very large data sets, split across multiple files (each “full” data file is 1.5gb and there are often several of these files (I am looking at one now that has 10)

The data effectively contains a series of buffers that I want to access 1 or more at a time.

|headerInfo-datablock|HeaderInfo-datablock|HeaderInfo-datablock| (thousands)

I want to go through the data file, filling a database with index information (so i can access specific blocks quickly based of either information in the header or the datablock itself). If I can I would also want to blit information to a graph image as I do it.

Hardware

The machine it will be ran on is a proper workstation PC so there is plenty of ram and processing power to utilize 🙂

On the top spec machine there is 64GB of ram and a i7 that is 12 cores (hyperthreaded) so in theory i could get away with loading the whole file into memory and then processing. But some of the lower spec machines have a lot less ram and the files that people are producing are getting bigger every day, so Its not very forward thinking to rely on that plan.

Technology

I am using C# so any tips on the best ways to judge the hardware capabilities in C# (at run time) and maximize them when accessing a set of large files, would be a great bonus

10

Your main bottle neck will always be IO unless you are doing some seriously intensive computations. Your best bet for squeezing the most performance out of your target machine to read all files serially (one at a time) and process each file concurrently (multiple calculation pipelines). Since you are using C#, I would suggest you look into using the Task Parallel Library for your calculation pipeline. The task scheduler is pretty darn smart about CPU utilization. You can provide it hints by specifying that particular tasks are going to be long running, thus requiring their own thread.

Design your processing pipeline such that it “pulls” data through and you’ll never have more that one file in memory at a time. This means that every function which moves the pipeline forward must have some mechanism for bringing data in from the previous stage. The most common example of this type of mechanism in C# is the IEnumerable<T> and IEnumerator<T> interface pair and how they work with LINQ. You can think of LINQ statements as a series of pipeline operations that do no actual work until it is requested by some greedy function like ToArray().

3

You should throw as many I/O jobs as possible and let the OS does its job, use async I/O to do that or mmap(). Don’t assume you know how to it better than the OS, instead you can give hint. That’s why there’s call like madvise(), to let the OS know if you only need the data to be read once or sequentially, etc. Yes, even with magnetic disks you want to use every spindle and try to saturate the i/o bandwidth.

The only thing you shouldn’t do is use more memory than what you have. Trashing happens when OS has to read something, discard and read it again. It’s not the same as keeping the system busy, which is the goal of having good OS (high utilisation).

2

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật