You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2020/02/26 18:00:34 UTC
[GitHub] [airflow] ashb opened a new pull request #7552: [AIRFLOW-5354]
Reduce scheduler CPU usage from 100%
ashb opened a new pull request #7552: [AIRFLOW-5354] Reduce scheduler CPU usage from 100%
URL: https://github.com/apache/airflow/pull/7552
A previous change ended up with the scheduler busily checking if the
DagFDagFileProcessorAgent had collected any dags. This simple change
takes the CPU usage of the scheduler from an entire core, to barely
anything (dropped below 5%).
Time for 10 dag runs of 9 dags with 108 total tasks: 50.3581s (±9.538s)
vs master of Time for 10 dag runs of 9 dags with 108 total tasks: 49.6910s (±7.193s)
The change is is basically no overall change, and is a quick fix for
now, and bigger changes are in store around DAG parsing anyway.
---
Issue link: WILL BE INSERTED BY [boring-cyborg](https://github.com/kaxil/boring-cyborg)
Make sure to mark the boxes below before creating PR: [x]
- [x] Description above provides context of the change
- [x] Commit message/PR title starts with `[AIRFLOW-NNNN]`. AIRFLOW-NNNN = JIRA ID<sup>*</sup>
- [x] Unit tests coverage for changes (not needed for documentation changes)
- [x] Commits follow "[How to write a good git commit message](http://chris.beams.io/posts/git-commit/)"
- [x] Relevant documentation is updated including usage instructions.
- [x] I will engage committers as explained in [Contribution Workflow Example](https://github.com/apache/airflow/blob/master/CONTRIBUTING.rst#contribution-workflow-example).
<sup>*</sup> For document-only changes commit message can start with `[AIRFLOW-XXXX]`.
---
In case of fundamental code change, Airflow Improvement Proposal ([AIP](https://cwiki.apache.org/confluence/display/AIRFLOW/Airflow+Improvements+Proposals)) is needed.
In case of a new dependency, check compliance with the [ASF 3rd Party License Policy](https://www.apache.org/legal/resolved.html#category-x).
In case of backwards incompatible changes please leave a note in [UPDATING.md](https://github.com/apache/airflow/blob/master/UPDATING.md).
Read the [Pull Request Guidelines](https://github.com/apache/airflow/blob/master/CONTRIBUTING.rst#pull-request-guidelines) for more information.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [airflow] ashb edited a comment on issue #7552: [AIRFLOW-5354]
Reduce scheduler CPU usage from 100%
Posted by GitBox <gi...@apache.org>.
ashb edited a comment on issue #7552: [AIRFLOW-5354] Reduce scheduler CPU usage from 100%
URL: https://github.com/apache/airflow/pull/7552#issuecomment-591565919
This change may only affect master. I don't see the 100% cpu usage on 1.10.7 or 1.10.9 at least.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [airflow] codecov-io commented on issue #7552: [AIRFLOW-5354]
Reduce scheduler CPU usage from 100%
Posted by GitBox <gi...@apache.org>.
codecov-io commented on issue #7552: [AIRFLOW-5354] Reduce scheduler CPU usage from 100%
URL: https://github.com/apache/airflow/pull/7552#issuecomment-591621802
# [Codecov](https://codecov.io/gh/apache/airflow/pull/7552?src=pr&el=h1) Report
> Merging [#7552](https://codecov.io/gh/apache/airflow/pull/7552?src=pr&el=desc) into [master](https://codecov.io/gh/apache/airflow/commit/1110faafb3d248f91b652d4e9617aba0d2505d58?src=pr&el=desc) will **decrease** coverage by `0.23%`.
> The diff coverage is `100%`.
[](https://codecov.io/gh/apache/airflow/pull/7552?src=pr&el=tree)
```diff
@@ Coverage Diff @@
## master #7552 +/- ##
==========================================
- Coverage 86.6% 86.36% -0.24%
==========================================
Files 896 896
Lines 42652 42656 +4
==========================================
- Hits 36937 36841 -96
- Misses 5715 5815 +100
```
| [Impacted Files](https://codecov.io/gh/apache/airflow/pull/7552?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [airflow/utils/dag\_processing.py](https://codecov.io/gh/apache/airflow/pull/7552/diff?src=pr&el=tree#diff-YWlyZmxvdy91dGlscy9kYWdfcHJvY2Vzc2luZy5weQ==) | `86.42% <100%> (+5.16%)` | :arrow_up: |
| [...w/providers/apache/hive/operators/mysql\_to\_hive.py](https://codecov.io/gh/apache/airflow/pull/7552/diff?src=pr&el=tree#diff-YWlyZmxvdy9wcm92aWRlcnMvYXBhY2hlL2hpdmUvb3BlcmF0b3JzL215c3FsX3RvX2hpdmUucHk=) | `35.84% <0%> (-64.16%)` | :arrow_down: |
| [airflow/kubernetes/volume\_mount.py](https://codecov.io/gh/apache/airflow/pull/7552/diff?src=pr&el=tree#diff-YWlyZmxvdy9rdWJlcm5ldGVzL3ZvbHVtZV9tb3VudC5weQ==) | `44.44% <0%> (-55.56%)` | :arrow_down: |
| [airflow/kubernetes/volume.py](https://codecov.io/gh/apache/airflow/pull/7552/diff?src=pr&el=tree#diff-YWlyZmxvdy9rdWJlcm5ldGVzL3ZvbHVtZS5weQ==) | `52.94% <0%> (-47.06%)` | :arrow_down: |
| [airflow/security/kerberos.py](https://codecov.io/gh/apache/airflow/pull/7552/diff?src=pr&el=tree#diff-YWlyZmxvdy9zZWN1cml0eS9rZXJiZXJvcy5weQ==) | `30.43% <0%> (-45.66%)` | :arrow_down: |
| [airflow/kubernetes/pod\_launcher.py](https://codecov.io/gh/apache/airflow/pull/7552/diff?src=pr&el=tree#diff-YWlyZmxvdy9rdWJlcm5ldGVzL3BvZF9sYXVuY2hlci5weQ==) | `47.18% <0%> (-45.08%)` | :arrow_down: |
| [airflow/providers/mysql/operators/mysql.py](https://codecov.io/gh/apache/airflow/pull/7552/diff?src=pr&el=tree#diff-YWlyZmxvdy9wcm92aWRlcnMvbXlzcWwvb3BlcmF0b3JzL215c3FsLnB5) | `55% <0%> (-45%)` | :arrow_down: |
| [...viders/cncf/kubernetes/operators/kubernetes\_pod.py](https://codecov.io/gh/apache/airflow/pull/7552/diff?src=pr&el=tree#diff-YWlyZmxvdy9wcm92aWRlcnMvY25jZi9rdWJlcm5ldGVzL29wZXJhdG9ycy9rdWJlcm5ldGVzX3BvZC5weQ==) | `69.69% <0%> (-25.26%)` | :arrow_down: |
| [airflow/kubernetes/refresh\_config.py](https://codecov.io/gh/apache/airflow/pull/7552/diff?src=pr&el=tree#diff-YWlyZmxvdy9rdWJlcm5ldGVzL3JlZnJlc2hfY29uZmlnLnB5) | `50.98% <0%> (-23.53%)` | :arrow_down: |
| [airflow/providers/apache/hive/hooks/hive.py](https://codecov.io/gh/apache/airflow/pull/7552/diff?src=pr&el=tree#diff-YWlyZmxvdy9wcm92aWRlcnMvYXBhY2hlL2hpdmUvaG9va3MvaGl2ZS5weQ==) | `76.02% <0%> (-1.54%)` | :arrow_down: |
| ... and [8 more](https://codecov.io/gh/apache/airflow/pull/7552/diff?src=pr&el=tree-more) | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/airflow/pull/7552?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/airflow/pull/7552?src=pr&el=footer). Last update [1110faa...4a4b29b](https://codecov.io/gh/apache/airflow/pull/7552?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [airflow] ashb commented on a change in pull request #7552:
[AIRFLOW-5354] Reduce scheduler CPU usage from 100%
Posted by GitBox <gi...@apache.org>.
ashb commented on a change in pull request #7552: [AIRFLOW-5354] Reduce scheduler CPU usage from 100%
URL: https://github.com/apache/airflow/pull/7552#discussion_r384706119
##########
File path: airflow/utils/dag_processing.py
##########
@@ -426,7 +426,7 @@ def harvest_simple_dags(self):
:return: List of parsing result in SimpleDag format.
"""
# Receive any pending messages before checking if the process has exited.
- while self._parent_signal_conn.poll():
+ while self._parent_signal_conn.poll(timeout=0.01):
Review comment:
Yes, which says check but don't wait. (None is wait forever)
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [airflow] ashb merged pull request #7552: [AIRFLOW-5354] Reduce
scheduler CPU usage from 100%
Posted by GitBox <gi...@apache.org>.
ashb merged pull request #7552: [AIRFLOW-5354] Reduce scheduler CPU usage from 100%
URL: https://github.com/apache/airflow/pull/7552
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [airflow] ashb commented on issue #7552: [AIRFLOW-5354] Reduce
scheduler CPU usage from 100%
Posted by GitBox <gi...@apache.org>.
ashb commented on issue #7552: [AIRFLOW-5354] Reduce scheduler CPU usage from 100%
URL: https://github.com/apache/airflow/pull/7552#issuecomment-591565919
This change may only affect master. I don't see the 100% cpu usage on 1.10.7 at least.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [airflow] kaxil commented on a change in pull request #7552:
[AIRFLOW-5354] Reduce scheduler CPU usage from 100%
Posted by GitBox <gi...@apache.org>.
kaxil commented on a change in pull request #7552: [AIRFLOW-5354] Reduce scheduler CPU usage from 100%
URL: https://github.com/apache/airflow/pull/7552#discussion_r384691426
##########
File path: airflow/utils/dag_processing.py
##########
@@ -426,7 +426,7 @@ def harvest_simple_dags(self):
:return: List of parsing result in SimpleDag format.
"""
# Receive any pending messages before checking if the process has exited.
- while self._parent_signal_conn.poll():
+ while self._parent_signal_conn.poll(timeout=0.01):
Review comment:
What is the default timeout? Is it `0`?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services