Replies: 1 comment 6 replies
-
Hey @Drignoid thanks for bringing this up 👍 Sound like you're looking for reactphp/http, clue/reactphp-csv and friends-of-reactphp/mysql. My question here is: why don't you want to use Composer for the project installations? Composer makes it rather easy to install all project dependencies via one command instead of installing each dependency from scratch. I don't have much information about your code base but it sounds like you're sending an http request with your csv file and then wait for the database to process the whole file before receiving a response. This means you have to wait for your response as long as it takes for the database to insert your data. This results in the Gateway Timeout you're seeing. One way to prevent this is to send out the request containing your csv file and then receive an immediate response from the server saying something like "received data". This way you don't have to wait for the database to finish its operation. You could also improve the behavior of inserting the data. As I already said, I don't know what your code looks like, so I can only assume how your server behaves. If you insert every single row at once from the csv file, you can improve that by gathering multiple lines on the server side and then insert the whole collection of rows instead of doing one by one. This can speed up this database process significantly 🚀 I hope this helps you progressing. If you need more input, it's definitely useful to share some more information about your use case, the error message your seeing and the behavior of your code. What do you think about this? |
Beta Was this translation helpful? Give feedback.
-
Hi Guys, from my research ReactPHP seems what I'm looking for: a few questions. Background - I'm running a web application on Apache, MySQL 8 and PHP 7.4 with the requirement to upload csv files (1.2 million lines) and extract the data to insert into the database and facing a Gateway Timeout (I believe it's set to 2 minutes), the gateway has not received a timely response from your server error/message (or similar). This process works fine without the gateway overlay (internal url address).
Questions - How do I install without Composer (not on my server and not sure I have permission to install it), which ReactPHP package should I use (http or csv) and will the package send gateway acceptable responses? Thanks in advance.
Beta Was this translation helpful? Give feedback.
All reactions