cozos edited a comment on issue #25899: [SPARK-29089][SQL] Parallelize blocking 
FileSystem calls in DataSource#checkAndGlobPathIfNecessary
URL: https://github.com/apache/spark/pull/25899#issuecomment-546554461
 
 
   @steveloughran Sorry for the delay. Been busy past couple weeks.
   
   Here are the results for the test with various num threads and threadpool 
size:
   
   This is on an Amazon Linux EC2 Instance in us-west-2 (`c3.xlarge`) with 4 
vCPUs.
   
   `fs.s3a.threads.keepalivetime` was set to `300`. The runtime is the average 
of 5 runs.
   
   Types:
   - Flat Paths: 1206 S3 Paths (recursive list of 
`s3a://landsat-pds/L8/001/003/`)
   - Glob Paths: 30 Glob Paths (ex. 
`s3a://landsat-pds/L8/001/003/LC80010032016262LGN00/*`) resulting in 1206 S3 
Paths
   
   ```
   ______________________________________________________________________
   | Type      | fs.s3a.connection.maximum| Num Threads| Runtime(seconds)|
   |=====================================================================|
   | Flat Paths| 48                       | 10         | 17.68           |
   | Flat Paths| 48                       | 20         | 9.39            |
   | Flat Paths| 48                       | 40         | 5.12            |
   | Flat Paths| 48                       | 60         | 5.37            |
   | Flat Paths| 48                       | 80         | 4.64            |
   | Flat Paths| 48                       | 100        | 4.87            |
   | Flat Paths| 48                       | 150        | 5.01            |
   | Flat Paths| 48                       | 200        | 4.74            |
   | Flat Paths| 100                      | 10         | 16.48           |
   | Flat Paths| 100                      | 20         | 8.82            |
   | Flat Paths| 100                      | 40         | 5.62            |
   | Flat Paths| 100                      | 60         | 5.37            |
   | Flat Paths| 100                      | 80         | 5.2             |
   | Flat Paths| 100                      | 100        | 4.98            |
   | Flat Paths| 100                      | 150        | 4.03            |
   | Flat Paths| 100                      | 200        | 4.76            |
   | Flat Paths| 300                      | 10         | 16.43           |
   | Flat Paths| 300                      | 20         | 9.7             |
   | Flat Paths| 300                      | 40         | 4.93            |
   | Flat Paths| 300                      | 60         | 5.49            |
   | Flat Paths| 300                      | 80         | 5.24            |
   | Flat Paths| 300                      | 100        | 4.81            |
   | Flat Paths| 300                      | 150        | 5.79            |
   | Flat Paths| 300                      | 200        | 5.16            |
   | Glob Paths| 48                       | 10         | 6.94            |
   | Glob Paths| 48                       | 20         | 2.71            |
   | Glob Paths| 48                       | 40         | 4.5             |
   | Glob Paths| 48                       | 60         | 2.95            |
   | Glob Paths| 48                       | 80         | 3.24            |
   | Glob Paths| 48                       | 100        | 2.69            |
   | Glob Paths| 48                       | 150        | 2.43            |
   | Glob Paths| 48                       | 200        | 2.28            |
   | Glob Paths| 100                      | 10         | 2.46            |
   | Glob Paths| 100                      | 20         | 2.2             |
   | Glob Paths| 100                      | 40         | 2.53            |
   | Glob Paths| 100                      | 60         | 2.35            |
   | Glob Paths| 100                      | 80         | 2.73            |
   | Glob Paths| 100                      | 100        | 2.45            |
   | Glob Paths| 100                      | 150        | 2.74            |
   | Glob Paths| 100                      | 200        | 2.68            |
   | Glob Paths| 300                      | 10         | 2.86            |
   | Glob Paths| 300                      | 20         | 2.34            |
   | Glob Paths| 300                      | 40         | 2.67            |
   | Glob Paths| 300                      | 60         | 2.83            |
   | Glob Paths| 300                      | 80         | 2.41            |
   | Glob Paths| 300                      | 100        | 2.76            |
   | Glob Paths| 300                      | 150        | 3.1             |
   | Glob Paths| 300                      | 200        | 3.08            |
   
   FileSystem org.apache.hadoop.fs.s3a.S3AFileSystem: 0 bytes read, 0 bytes 
written, 151800 read ops, 0 large read ops, 0 write ops
   ```
   
   To me, it seems like the sweet spot is still at 40 threads, and the s3a 
thread pool doesn't make a big difference (On EC2, on remote dev it did). 
Perhaps I am missing `fs.s3a.max.total.tasks` (although it shouldn't matter 
from my understanding of your description). The other factor is my EC2 instance 
only has 4 vcores, but I'd imagine that's a typical driver size.
   
   You can see the code here: 
https://github.com/cozos/spark/pull/4/files#diff-459ad9c8e9c535d7acf5abb384194435R27

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to