Bind MyDac Connection to specific ethernet port

Discussion of open issues, suggestions and bugs regarding MyDAC (Data Access Components for MySQL) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
Tim Hayes
Posts: 5
Joined: Sat 30 Sep 2017 16:06

Bind MyDac Connection to specific ethernet port

Post by Tim Hayes » Fri 19 Jul 2019 14:43

Hi everyone,

I am developing an application which makes multiple threaded API calls to Google Vision and collects OCR data to write back to the MySQL database using MyDAC. The data volumes are large and I need to optimize network and internet access.


Because of network contention between the two operations (api vs data access) I have installed two ethernet connections, one for connection to the internet for Google and the other on the local network to connect to the database servers.


I would like to be able to bind the TMyConnection to a specific ethernet connection / IP address. Is there a way to achieve this with MyDAC???


Many thanks.

Regards

Tim Hayes

ViktorV
Devart Team
Posts: 2793
Joined: Wed 30 Jul 2014 07:16

Re: Bind MyDac Connection to specific ethernet port

Post by ViktorV » Mon 22 Jul 2019 13:36

The binding occurs at the network level and belongs to the scope of configuring and administering your network. Please describe in more detail why you need this option.

Tim Hayes
Posts: 5
Joined: Sat 30 Sep 2017 16:06

Re: Bind MyDac Connection to specific ethernet port

Post by Tim Hayes » Tue 23 Jul 2019 21:02

Hi Viktor V,

Thanks for responding. Let me be more explicit.

There are multiple client-side applications uploading batches of images (circa 2mb each) to individual MySQL databases (actually a Percona Cluster using 3 servers). At any time, say 50-350 images will be posted by a client. The batch and page references (all GUIDs) are recorded in a cluster-wide database,

Server-side I have a Delphi service which accesses the batch headers and image references in blocks of (say) 64 image references. Multiple threads are created (optimally 5 per second) which (a) read the image data and send it to Google Vision API for document text recognition. The returned JSON (around 3mb) (b) is reprocessed by the thread to extract the data required by the client application and writes the information back to the individual client database on the server.

I am currently using a Quad core processor with gigabit LAN ethernet connectivity. Standalone, process (b) will write around 8 records per second.

Standalone process(a) operates at around 1.8 seconds per API call. Using more threads (say 10) increases the overall throughput. BUT, when running concurrently with process (b) the IO to the database drops to around 2 IO operations per second. This increases the overall run time for the batch by around 33%.

By monitoring the Network activity on the server I conclude that there is contention for network resources since both the Google API and the database IO are using the same single ethernet port.

In order to minimise this contention I have added a second ethernet port with a view to driving both (a) and (b) in parallel. Then comes the problem, which is that the Delphi THttpClient does not appear to have a BoundIP property which is present on TidHTTP (which is not happy in multi-thread mode).

Unless I employ an expensive alternative (e.g /n software) my only other option is to ask if MyDAC connection can be configured to bin it to a specific ethernet port.

Does this assist?

Many thanks.

Tim Hayes

ViktorV
Devart Team
Posts: 2793
Joined: Wed 30 Jul 2014 07:16

Re: Bind MyDac Connection to specific ethernet port

Post by ViktorV » Wed 24 Jul 2019 10:06

Currently, MyDAC does not support the functionality you specified.
If you want us to implement the feature, please post this suggestion at our user voice forum: https://devart.uservoice.com/forums/104 ... omponents/ If the suggestion gets a lot of votes, we will consider the possibility to implement it.

Post Reply