PHP execution hangs (?)

Support requests, bug reports, etc. go here. Dedicated servers / VDS hosting only
flosch
Bear Rating Trainee
Bear Rating Trainee
Posts: 4
Joined: 22 Mar 2012, 17:36

PHP execution hangs (?)

Postby flosch » 22 Mar 2012, 17:56


User avatar
fox
^ me reading your posts ^
Posts: 6318
Joined: 27 Aug 2005, 22:53
Location: Saint-Petersburg, Russia
Contact:

Re: PHP execution hangs (?)

Postby fox » 23 Mar 2012, 21:05

It seems that some HTML code in the article makes HTMLPurifier go crazy. It's probably something in your Fresh feed, otherwise it wouldn't be loaded on startup.

You can open tt-rss with developer console open (F12 in chrome) and see the last query that timeouts.

flosch
Bear Rating Trainee
Bear Rating Trainee
Posts: 4
Joined: 22 Mar 2012, 17:36

Re: PHP execution hangs (?)

Postby flosch » 24 Mar 2012, 12:35

That was it. I experimented around a bit more, and could narrow it down to a specific feed relatively quickly. It was a news feed that contained several posts with a LOT of links. After I realized that that, I decided to just try my luck, set max_execution_time to 3600 and let it run. It took about 20 minutes or so, then it was done. I marked those posts as read, and now tt-rss is as fast as ever (I just shouldn't "show all" while these posts are still in the DB.)

Sorry for the false alarm.

Though, many links or not, I'm still surprised those few posts made the difference between a couple of seconds of loading time, and 20 minutes.

edit: Do you know whether it is normal that Apache children just segfault under these conditions?

paddlaren
Bear Rating Trainee
Bear Rating Trainee
Posts: 15
Joined: 13 Oct 2012, 10:52
Location: Hörby/Skåne/Sweden

Re: PHP execution hangs (?)

Postby paddlaren » 21 Oct 2012, 17:13

I have some feeds making heavy use of links. The only thing that seems to solve my problems is to disable htmlpurifyer. I tried to use longer execution time without success.

This is copied from my lighttpd error log:
2012-10-21 13:49:25: (mod_fastcgi.c.2543) unexpected end-of-file (perhaps the fastcgi process died): pid: 0 socket: unix:/run/php-fpm/php-fpm.sock
2012-10-21 13:49:25: (mod_fastcgi.c.3329) response not received, request sent: 1386 on socket: unix:/run/php-fpm/php-fpm.sock for /backend.php?, closing connection


The question I now have is if it is possible to run the html-purifier off line or as background task to allow longer execution times. Can it be part of the update.php?
When is the actual feed read? Is the feed stored in database or only the item id:s? If the feed is read and buffered in the database until purging I supose it would be possible to make purufication as a separate task or as part of the update task.

I am currently running updates every 4 minutes instead of every 60 seconds.

BR
Erik

User avatar
fox
^ me reading your posts ^
Posts: 6318
Joined: 27 Aug 2005, 22:53
Location: Saint-Petersburg, Russia
Contact:

Re: PHP execution hangs (?)

Postby fox » 21 Oct 2012, 18:06

I can of course use purifier while updating, the only difference would be that it would hang the daemon or your cronjob, which is not exactly better.

The correct solution would be for htmlpurifier to fix the hanging or for me to replace it with something else, but I'm not aware of any alternatives and I don't think anyone ever submitted the bug to them.

paddlaren
Bear Rating Trainee
Bear Rating Trainee
Posts: 15
Joined: 13 Oct 2012, 10:52
Location: Hörby/Skåne/Sweden

Re: PHP execution hangs (?)

Postby paddlaren » 21 Oct 2012, 20:03

What is the risks I take by not using it?

User avatar
fox
^ me reading your posts ^
Posts: 6318
Joined: 27 Aug 2005, 22:53
Location: Saint-Petersburg, Russia
Contact:

Re: PHP execution hangs (?)

Postby fox » 21 Oct 2012, 20:13

XSS attacks, this sort of thing. If you don't read questionable feeds, you'll be fine.

User avatar
fox
^ me reading your posts ^
Posts: 6318
Joined: 27 Aug 2005, 22:53
Location: Saint-Petersburg, Russia
Contact:

Re: PHP execution hangs (?)

Postby fox » 28 Oct 2012, 12:42

As of current trunk, I have replaced htmlpurifier with htmLawed, http://www.bioinformatics.org/phplabwar ... /htmLawed/

Also, sanitizing of content now happens while updating which should speed up things a bit.

paddlaren
Bear Rating Trainee
Bear Rating Trainee
Posts: 15
Joined: 13 Oct 2012, 10:52
Location: Hörby/Skåne/Sweden

Re: PHP execution hangs (?)

Postby paddlaren » 28 Oct 2012, 17:44

Miss the like button in the forum ;)

Are looking forward to next release.


Return to “Support”

Who is online

Users browsing this forum: No registered users and 8 guests