Jump to content

Background Tasks Speedup?


maddog107_merged
 Share

Recommended Posts

Hello,

 

I have a question about the Background Tasks that are done immediatlly after the upgrade from 3.x to 4.1.4. So I have added 
/usr/bin/php -d memory_limit=-1 -d max_execution_time=0 /var/www/html/domain.com/main/applications/core/interface/task/task.php 893483489389489ahr88

 

and I see it run in cron but I see essentially 0 CPU utilization and 0 mysql usage in 'top'. In 12 hours its only done 
Updating Attachments storage URLs
1.37%
Deleting legacy topic data
24.95126705653%
Deleting legacy post data
8.9390386869871%
Updating Attachments storage URLs
1.6%

 

And 0% for everything else. So the question I have is two fold. First is it possible to run in parallel, meaning is there someway I can kick off 
Rebuilding Signatures
Rebuilding posts
Rebuilding topics
Rebuilding announcements
etc...

 

At the same time or is it sequential that it requires the deleting legacy stuff first to complete before it can run the rest? I have 24threads/64gb available and as mentioned its doing essentially nothing.

 

The other question does this use a "$perCycle" like the upgrader does? I increased the "perCycle" on the upgrader and it went from 36hour upgrade to a 8hour upgrade time and was utilizing 1 CPU at 100% and Mysql at 50%.

 

Thanks.

Link to comment
Share on other sites

Maybe someone who understands the code better then I do but is this doing essentially a "LIMIT" or what is the array(0 , 5) specifying? So can I increase that to say 0, 500 to select 500 rows at a time to loop through?

less applications/forums/extensions/core/Queue/DeleteLegacyTopics.php

        public function run( $data, $offset )
        {
                $select = \IPS\Db::i()->select( '*', 'forums_topics', 'approved > 1', 'tid ASC', array( 0, 5 ) );
                if ( !count( $select ) )
                {
                        throw new \OutOfRangeException;
                }
                
                $done = 0;
                foreach( new \IPS\Patterns\ActiveRecordIterator( $select, 'IPS\forums\Topic' ) as $topic )
                {
                        $topic->delete();
                        $done++;
                }
                
                return $offset + $done;
        }

 

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...