Commit 1c70da3
[SPARK-20657][CORE] Speed up rendering of the stages page.
There are two main changes to speed up rendering of the tasks list
when rendering the stage page.
The first one makes the code only load the tasks being shown in the
current page of the tasks table, and information related to only
those tasks. One side-effect of this change is that the graph that
shows task-related events now only shows events for the tasks in
the current page, instead of the previously hardcoded limit of "events
for the first 1000 tasks". That ends up helping with readability,
though.
To make sorting efficient when using a disk store, the task wrapper
was extended to include many new indices, one for each of the sortable
columns in the UI, and metrics for which quantiles are calculated.
The second changes the way metric quantiles are calculated for stages.
Instead of using the "Distribution" class to process data for all task
metrics, which requires scanning all tasks of a stage, the code now
uses the KVStore "skip()" functionality to only read tasks that contain
interesting information for the quantiles that are desired.
This is still not cheap; because there are many metrics that the UI
and API track, the code needs to scan the index for each metric to
gather the information. Savings come mainly from skipping deserialization
when using the disk store, but the in-memory code also seems to be
faster than before (most probably because of other changes in this
patch).
To make subsequent calls faster, some quantiles are cached in the
status store. This makes UIs much faster after the first time a stage
has been loaded.
With the above changes, a lot of code in the UI layer could be simplified.
Author: Marcelo Vanzin <[email protected]>
Closes #20013 from vanzin/SPARK-20657.1 parent 87c98de commit 1c70da3
File tree
18 files changed
+1361
-986
lines changed- common/kvstore/src/main/java/org/apache/spark/util/kvstore
- core/src
- main/scala/org/apache/spark
- status
- api/v1
- ui/jobs
- test
- resources/HistoryServerExpectations
- scala/org/apache/spark
- status
- ui
18 files changed
+1361
-986
lines changedLines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
83 | 83 | | |
84 | 84 | | |
85 | 85 | | |
| 86 | + | |
86 | 87 | | |
87 | 88 | | |
88 | 89 | | |
| |||
Lines changed: 42 additions & 15 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
377 | 377 | | |
378 | 378 | | |
379 | 379 | | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
380 | 384 | | |
381 | 385 | | |
382 | 386 | | |
| |||
433 | 437 | | |
434 | 438 | | |
435 | 439 | | |
436 | | - | |
| 440 | + | |
437 | 441 | | |
438 | 442 | | |
439 | 443 | | |
| |||
450 | 454 | | |
451 | 455 | | |
452 | 456 | | |
453 | | - | |
| 457 | + | |
454 | 458 | | |
455 | 459 | | |
456 | 460 | | |
| |||
486 | 490 | | |
487 | 491 | | |
488 | 492 | | |
489 | | - | |
| 493 | + | |
490 | 494 | | |
491 | 495 | | |
492 | 496 | | |
| |||
604 | 608 | | |
605 | 609 | | |
606 | 610 | | |
607 | | - | |
| 611 | + | |
608 | 612 | | |
609 | 613 | | |
610 | 614 | | |
611 | | - | |
| 615 | + | |
612 | 616 | | |
613 | 617 | | |
614 | 618 | | |
| |||
690 | 694 | | |
691 | 695 | | |
692 | 696 | | |
693 | | - | |
| 697 | + | |
694 | 698 | | |
695 | 699 | | |
696 | 700 | | |
| |||
814 | 818 | | |
815 | 819 | | |
816 | 820 | | |
817 | | - | |
| 821 | + | |
818 | 822 | | |
819 | 823 | | |
820 | 824 | | |
| |||
865 | 869 | | |
866 | 870 | | |
867 | 871 | | |
868 | | - | |
| 872 | + | |
869 | 873 | | |
870 | 874 | | |
871 | 875 | | |
| |||
885 | 889 | | |
886 | 890 | | |
887 | 891 | | |
888 | | - | |
| 892 | + | |
889 | 893 | | |
890 | 894 | | |
891 | 895 | | |
892 | 896 | | |
893 | 897 | | |
894 | 898 | | |
895 | | - | |
896 | | - | |
| 899 | + | |
| 900 | + | |
897 | 901 | | |
898 | 902 | | |
899 | 903 | | |
| |||
905 | 909 | | |
906 | 910 | | |
907 | 911 | | |
908 | | - | |
| 912 | + | |
909 | 913 | | |
| 914 | + | |
| 915 | + | |
910 | 916 | | |
911 | 917 | | |
912 | 918 | | |
| |||
919 | 925 | | |
920 | 926 | | |
921 | 927 | | |
922 | | - | |
| 928 | + | |
923 | 929 | | |
924 | | - | |
| 930 | + | |
925 | 931 | | |
926 | 932 | | |
927 | 933 | | |
| |||
930 | 936 | | |
931 | 937 | | |
932 | 938 | | |
933 | | - | |
| 939 | + | |
934 | 940 | | |
935 | 941 | | |
| 942 | + | |
| 943 | + | |
| 944 | + | |
| 945 | + | |
| 946 | + | |
| 947 | + | |
| 948 | + | |
| 949 | + | |
| 950 | + | |
936 | 951 | | |
937 | 952 | | |
938 | 953 | | |
939 | 954 | | |
| 955 | + | |
| 956 | + | |
| 957 | + | |
| 958 | + | |
| 959 | + | |
| 960 | + | |
| 961 | + | |
| 962 | + | |
| 963 | + | |
| 964 | + | |
| 965 | + | |
| 966 | + | |
940 | 967 | | |
941 | 968 | | |
942 | 969 | | |
| |||
0 commit comments