iemejia commented on code in PR #12400:
URL: https://github.com/apache/gluten/pull/12400#discussion_r3560769165


##########
backends-velox/src/main/scala/org/apache/gluten/config/VeloxConfig.scala:
##########
@@ -534,10 +535,35 @@ object VeloxConfig extends ConfigRegistry {
   val COLUMNAR_VELOX_FILE_HANDLE_CACHE_ENABLED =
     
buildStaticConf("spark.gluten.sql.columnar.backend.velox.fileHandleCacheEnabled")
       .doc(
-        "Disables caching if false. File handle cache should be disabled " +
-          "if files are mutable, i.e. file content may change while file path 
stays the same.")
+        "Enables caching of file handles to avoid repeated open/close overhead 
on remote " +
+          "filesystems. Should be disabled if files are mutable, i.e. file 
content may " +
+          "change while file path stays the same.")
       .booleanConf
-      .createWithDefault(false)
+      .createWithDefault(true)
+
+  val COLUMNAR_VELOX_NUM_CACHE_FILE_HANDLES =
+    
buildStaticConf("spark.gluten.sql.columnar.backend.velox.numCacheFileHandles")
+      .doc(
+        "Maximum number of entries in the file handle cache. Each entry holds 
an open " +
+          "file descriptor (local FS) or connection state (remote FS). Note 
that on " +
+          "local filesystems, high values may approach the OS file descriptor 
limit " +
+          "(ulimit -n). On remote object stores (S3, ABFS, GCS) entries 
represent " +
+          "network connections/sockets rather than per-file OS file 
descriptors, but " +
+          "they can still count toward OS resource limits (ulimit -n).")
+      .intConf
+      .checkValue(_ > 0, "must be a positive number")
+      .createWithDefault(10000)

Review Comment:
   The default of 10000 matches the existing upstream Velox default 
(`HiveConfig::numCacheFileHandles()`). This is a maximum LRU cache capacity, 
not a count of simultaneously open file descriptors -- the cache evicts the 
least-recently-used entries when full, so the actual number of open handles is 
bounded by the number of distinct files accessed within the TTL window (default 
10min). In practice, most workloads access far fewer than 10000 distinct files 
within that window. The config doc already warns about `ulimit -n` on local 
filesystems for advanced tuning.



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to