B
B
BonBon Slick2017-05-16 16:08:59
PHP
BonBon Slick, 2017-05-16 16:08:59

504 Gateway Timeout - nginx/1.10.2?

Before executing the script, I set:
ini_set('max_execution_time', 7000);
The function is called by the adjax script in the cycle, if it gives a timeout error, then the cycle is interrupted.
The Error itself:

504 Gateway Time-out
-------------------------------------
nginx/1.10.2

More detailed request:
Request URL:http://serv2.timworld.info/admin/parser3/links?resource%5Bid%5D=686&resource%5Burl%5D=http%3A%2F%2Fargumentua.com%2F&resource%5Bparse_url%5D=http%3A%2F%2Fargumentua.com%2Fstati%2Fza-rubezhom&resource%5Bauthor%5D=39&resource%5Bpublish%5D=1&resource%5Btranslate%5D=0&resource%5Bonly_with_images%5D=1&resource%5Bremove_links%5D=1&resource%5Bvk%5D=0&resource%5Bfolder_id%5D=58&resource%5Bcreated_at%5D=2016-09-14+07%3A53%3A50&resource%5Bupdated_at%5D=2016-09-14+07%3A56%3A55&resource%5Bdisabled%5D=0&resource%5Bmin_chars%5D=1000&resource%5Blinks_rule%5D=h2+a&resource%5Bkeywords_rule%5D=meta%5Bname%3Dkeywords%5D&resource%5Bdescription_rule%5D=meta%5Bname%3Ddescription%5D&resource%5Btext_rule%5D=div.content+p&resource%5Bimage_rule%5D=div.pics+img&resource%5Btitle_rule%5D=h2
Request Method:GET
Status Code:504 Gateway Time-out
Remote Address:91.228.236.11:80
Referrer Policy:no-referrer-when-downgrade

Response Headers
view source
Connection:keep-alive
Content-Length:585
Content-Type:text/html; charset=koi8-r
Date:Tue, 16 May 2017 12:50:47 GMT
Server:nginx/1.10.2

Request Headers
view source
Accept:application/json, text/javascript, */*; q=0.01
Accept-Encoding:gzip, deflate, sdch
Accept-Language:ru-RU,ru;q=0.8,en-US;q=0.6,en;q=0.4,de;q=0.2,uk;q=0.2
Cache-Control:no-cache
Connection:keep-alive
Cookie:_ym_uid=14924233861071910793; last_visit=1494924034217::1494934834217; _ga=GA1.2.1524052246.1492423387; _gid=GA1.2.1274191901.1494934836; _ym_isad=1; laravel_session=eyJpdiI6ImdcLzZheU9PNDI0ZHJZd0p1Vk1hdGx3PT0iLCJ2YWx1ZSI6ImEzUUlXK2N0ZlZUeklcLzltcnRDTFwvQXhiUWErTVY0UGl0YzlWVzVvcXNhUFhjU3BjanFMY2Zzd2w2R1JaYzFVbFV4aWg2NWJXRVJ2OWxLT1wvNUhBeUN3PT0iLCJtYWMiOiI4MDVhNmI1ZmY3YTllNmFiOGVjMzI5ZTE2NDE1MDk1MWJlZGUzNDYwN2ZiZjMxOWIxYzRmYzg4NGI1MjMyZGIwIn0%3D
Host:serv2.timworld.info
Pragma:no-cache
Referer:http://serv2.timworld.info/admin/parser3
User-Agent:Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36
X-Requested-With:XMLHttpRequest
Query String Parameters
view source
view URL encoded
resource[id]:686
resource[url]:http://argumentua.com/
resource[parse_url]:http://argumentua.com/stati/za-rubezhom
resource[author]:39
resource[publish]:1
resource[translate]:0
resource[only_with_images]:1
resource[remove_links]:1
resource[vk]:0
resource[folder_id]:58
resource[created_at]:2016-09-14 07:53:50
resource[updated_at]:2016-09-14 07:56:55
resource[disabled]:0
resource[min_chars]:1000
resource[links_rule]:h2 a
resource[keywords_rule]:meta[name=keywords]
resource[description_rule]:meta[name=description]
resource[text_rule]:div.content p
resource[image_rule]:div.pics img
resource[title_rule]:h2

I think it might be worth fixing the script, adding something in the spirit of error handling.
Now it only costs
success:function(res){
                        if(count.length){
                            resources = res
                        } else {
// цикл который отправляет вновь обращение рнр функции
                            loopResources(res,0)
                        }
                    }

Answer the question

In order to leave comments, you need to log in

3 answer(s)
B
Boris Korobkov, 2017-05-16
@BonBonSlick

You have obvious problems with the application architecture and business processes. The web application should not run for more than a few seconds. Except for downloading, broadcasting, socket communication, and some others.
Move long-running processes to a queue handled by a separate console process or daemon.

O
OnYourLips, 2017-05-16
@OnYourLips

Increase the timeout in nginx.
And it is better to transfer such long tasks through queues to console handlers.

V
Viktor Taran, 2017-05-16
@shambler81

make an exception for the given file in the timeout and increase it significantly for it.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question