Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yii2
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Rotua Panjaitan
yii2
Commits
dfa1f3bf
Commit
dfa1f3bf
authored
Dec 27, 2014
by
Alexander Makarov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Elaborated on processing data in background in performance tuning guide
parent
905751bd
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
3 deletions
+13
-3
tutorial-performance-tuning.md
docs/guide/tutorial-performance-tuning.md
+13
-3
No files found.
docs/guide/tutorial-performance-tuning.md
View file @
dfa1f3bf
...
...
@@ -223,10 +223,20 @@ working with AR objects.
In order to respond to user requests faster you can process heavy parts of the
request later if there's no need for immediate response.
-
Cron jobs + console.
-
queues + handlers.
There are two common ways to achieve it: cron job processing and specialized queues.
TBD
In the first case we need to save data which processing we want to do later to persistent storage
such as database. A
[
console command
](
tutorial-console.md
)
that is run regularly via cron job queries
database and processes data if there's any.
The solution is OK for most cases but has one significant drawback. We aren't aware if there's data to
process before we query database so we're either querying database quite often or have a slight delay
between each data processing.
This issue could be solved by queue and job servers such RabbitMQ, ActiveMQ, Amazon SQS and more.
In this case instead of writing data to persistent storage you're queueing it via APIs provided
by queue or job server. Processing is often put into job handler class. Job from the queue is executed
right after all jobs before it are done.
### If nothing helps
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment