Now the mechanism for selecting updated data, in the action "Import products from CMS ExtraParts", is carried out by a request:
"SELECT * FROM `price` WHERE `post_date` >= '{$postDateFrom}' ORDER BY `price`.`id` ASC"
Where the variable '{$postDateFrom}' uses the time the action was last run.
The problem is that - when a large amount of updated data suddenly appears in `price' (for example, 4.6 Million), the action takes a large array of data (about 12G), the processing of which lasts for hours (about 5 hours), which leads to timeouts or errors in exported products or other data export failures ...
It is necessary to improve the mechanism for sampling updated data:
1. Take into account a limited (for example, 100,000 rows specified in the settings) amount of data for one action launch, process this array and stop the action.
At the Next Start of the Action, process the next amount of updated data and so on.
2. If two or more export actions work simultaneously (in parallel), the data between them must be distributed so that each of the actions does not process the same data.
Now the mechanism for selecting updated data, in the action "Import products from CMS ExtraParts", is carried out by a request: "SELECT * FROM `price` WHERE `post_date` >= '{$postDateFrom}' ORDER BY `price`.`id` ASC" Where the variable '{$postDateFrom}' uses the time the action was last run. The problem is that - when a large amount of updated data suddenly appears in `price' (for example, 4.6 Million), the action takes a large array of data (about 12G), the processing of which lasts for hours (about 5 hours), which leads to timeouts or errors in exported products or other data export failures ... It is necessary to improve the mechanism for sampling updated data: 1. Take into account a limited (for example, 100,000 rows specified in the settings) amount of data for one action launch, process this array and stop the action. At the Next Start of the Action, process the next amount of updated data and so on. 2. If two or more export actions work simultaneously (in parallel), the data between them must be distributed so that each of the actions does not process the same data.
Please clarify, is the problem that it all takes a long time to work or is it putting a load on the server? If it’s something that’s been running for a long time, we can pour data into parallel streams like 30-40, if it’s something that’s loading the server, then that’s a different question.
Oleksandr Grigorovich wrote: Brothers in the brow are surrounded (for example, it is indicated in the adjusted 100,000 rows)
Well, if you hit 100k, you will never catch up with the current state.
Please clarify, is the problem that it all takes a long time to work or is it putting a load on the server? If it’s something that’s been running for a long time, we can pour data into parallel streams like 30-40, if it’s something that’s loading the server, then that’s a different question.
[quote]
Oleksandr Grigorovich wrote:
Brothers in the brow are surrounded (for example, it is indicated in the adjusted 100,000 rows)
[/quote]
Well, if you hit 100k, you will never catch up with the current state.
Yes, the problem is that it takes a very long time, and the longer this process takes, the higher the likelihood of export failure. There are enough server resources, that’s why I suggested exporting in parts and in parallel actions
Yes, the problem is that it takes a very long time, and the longer this process takes, the higher the likelihood of export failure.
There are enough server resources, that’s why I suggested exporting in parts and in parallel actions
Alexander Grigorievich wrote: the higher the probability of export failure
Yes, what kind of failures are you seeing now in such situations?
Most often, if the export lasts for a very long time, then brands begin to be erased for products or new ones are created without a brand (the $brandid variable returns an empty value...) - this creates big problems.
[quote]
Care Department
OneBox production wrote:
[quote]
Alexander Grigorievich wrote:
the higher the probability of export failure
[/quote]
Yes, what kind of failures are you seeing now in such situations?
[/quote]
Most often, if the export lasts for a very long time, then brands begin to be erased for products or new ones are created without a brand (the $brandid variable returns an empty value...) - this creates big problems.
If there is a solution to speed up exports, which will allow you to successfully fill such a quantity and at the same time get rid of the loss of the brand, then issue an invoice.
If there is a solution to speed up exports, which will allow you to successfully fill such a quantity and at the same time get rid of the loss of the brand, then issue an invoice.
This solution will allow you to remember the entire list of brands and search for them from the cache, this will also speed up import a little, but I don’t think it will be global. Let's try, I'll issue an invoice
This solution will allow you to remember the entire list of brands and search for them from the cache, this will also speed up import a little, but I don’t think it will be global. Let's try, I'll issue an invoice
Care Department OneBox production wrote: This solution will allow you to remember the entire list of brands and search for them from the cache, this will also speed up import a little, but I don’t think it will be global. Let's try, I'll issue an invoice
The decision to take a brand from Cash will not be enough, I checked. I completely disabled the method for getting a brand in the class; updating it speeds up, but not enough. Is it possible to implement pouring into multiple threads?
[quote]
Care Department
OneBox production wrote:
This solution will allow you to remember the entire list of brands and search for them from the cache, this will also speed up import a little, but I don’t think it will be global. Let's try, I'll issue an invoice
[/quote]
The decision to take a brand from Cash will not be enough, I checked.
I completely disabled the method for getting a brand in the class; updating it speeds up, but not enough.
Is it possible to implement pouring into multiple threads?
I don’t care about the speed if in the end everything will flood normally. If we pour into several threads, we can heavily load the external database and our own.
I don’t care about the speed if in the end everything will flood normally. If we pour into several threads, we can heavily load the external database and our own.
Care Department OneBox production wrote: We can do it differently, I make it so that your downloading of 4 records works for example an hour, after which you pay according to the time spent.
I agree, we’ll keep guessing longer, you’ll figure it out as we go. Do it, I'll pay after the fact.
[quote]
Care Department
OneBox production wrote:
We can do it differently, I make it so that your downloading of 4 records works for example an hour, after which you pay according to the time spent.
[/quote]
I agree, we’ll keep guessing longer, you’ll figure it out as we go.
Do it, I'll pay after the fact.
Please join the conversation. If you have something to say - please write a comment. You will need a mobile phone and an SMS code for identification to enter.
Log in and comment
Donate
You don't have enough funds in your account Top up