Skip to content

Conversation

@PeterZh6
Copy link
Contributor

@PeterZh6 PeterZh6 commented Aug 27, 2024

Fixes #7056

Motivation

Currently, the total amount of resources for the Flink Sort Job comes from the configuration file flink-sort-plugin.properties, meaning that all submitted sort jobs will use the same amount of resources. When the data scale is large, the resources may be insufficient, and when the data scale is small, the resources may be wasted. Therefore, dynamically adjusting the number of resources according to the amount of data is a critically needed function.

Modifications

  • Before submitting a job to Flink with org.apache.inlong.manager.plugin.flink.FlinkService#submitJobBySavepoint, the org.apache.inlong.manager.plugin.flink.FlinkParallelismOptimizer will first query the average data volume of from the past hour of the DataProxy module and adjust the parallelism based on this data volume.
  • Meanwhile, this function can be swiched on or off and maxmimum message for one core can be configured in flink-sort-plugin.properties
  • Moved OpenApiConstants to org.apache.inlong.audit.consts

Verifying this change

  • This change is a trivial rework/code cleanup without any test coverage.

  • This change is already covered by existing tests, such as:
    When creating a stream in Data Ingestion, you can try to make the source data constantly increase and reach a significant amount (approximately more than 2000 per second). Then, resubmit the job. You should notice that the parallelism of the Flink job corresponding to the stream will be larger than the default value of 1. This change will also be reflected in the manager logs.

  • [] This change added tests and can be verified as follows:

@dockerzhang dockerzhang changed the title [INLONG-7056][Sort]Adjust sort resources according to data scale [INLONG-7056][Sort] Adjust sort resources according to data scale Aug 27, 2024
@PeterZh6 PeterZh6 marked this pull request as draft August 28, 2024 13:45
@PeterZh6 PeterZh6 marked this pull request as ready for review August 28, 2024 13:52
@PeterZh6 PeterZh6 requested a review from aloyszhang August 29, 2024 08:11
@aloyszhang
Copy link
Contributor

@fuweng11 There are some modifications in the manager module, PTAL

aloyszhang
aloyszhang previously approved these changes Aug 30, 2024
@fuweng11
Copy link
Contributor

fuweng11 commented Aug 30, 2024

When a group is a real-time synchronization task, there is no dataproxy present. How to handle this situation.Is there a default value when dataproxy does not exist?

@PeterZh6
Copy link
Contributor Author

When a group is a real-time synchronization task, there is no dataproxy present. How to handle this situation.Is there a default value when dataproxy does not exist?

When no audit data of DataProxy is present, the entity should be null, causing parseResponseAndCalculateAverageDataVolume to return DEFAULT_ERROR_DATA_VOLUME, which is 0L
image

@PeterZh6
Copy link
Contributor Author

PeterZh6 commented Aug 30, 2024

9ae2d21d-2ac7-4509-bc34-150e09bef3cc 9e8f6992-bb82-40f3-99b1-1445cea9f45b

Demo of adjusting parallelism is shown in the picture. (Failure is caused by resource limitation of my computer)

@PeterZh6 PeterZh6 requested a review from aloyszhang August 30, 2024 03:29
Copy link
Contributor

@aloyszhang aloyszhang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@dockerzhang dockerzhang merged commit 681e88d into apache:master Aug 31, 2024
MOONSakura0614 pushed a commit to MOONSakura0614/inlong that referenced this pull request Sep 3, 2024
wohainilaodou pushed a commit to wohainilaodou/inlong that referenced this pull request Oct 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature][Sort] Adjust sort resources according to data scale

5 participants