Introduction
Many OIC customers use the OIC File Server for file processing scenarios, MFT etc. This sftp server, however, has a concurrency limit -
So how do I know where I stand in relation to this limit of 50? For that there is an OCI Service Metric - File Server Inbound Connections.
The default MQL you see in the OIC Monitoring page in OCI is - FileserverInboundConnections[1m]{resourceId = "yourOIC OCID"}.grouping().sum()
More about this later.
I'm going to run a couple of tests to see how this metric surfaces, but, before doing so, please note that metric sampling currently happens every 5 minutes. So this metric may not deliver an exact view of concurrency, but can certainly help you isolate trends etc.
File Server Concurrent Connections Test
I run the test in Windows PowerShell; it will open up 10 connections and keep them open for 12 minutes.
try {
# Start 10 independent SFTP processes.
1..10 | ForEach-Object {
$info = New-Object System.Diagnostics.ProcessStartInfo
$info.FileName = (Get-Command sftp.exe).Source
$info.UseShellExecute = $false
$info.RedirectStandardInput = $true
$info.Arguments = (
'-b - -i "{0}" -oBatchMode=yes ' +
'-oControlMaster=no -oControlPath=none ' +
'-oConnectTimeout=20 -P {1} "{2}@{3}"'
) -f $KeyPath, $OicPort, $OicUser, $OicHost
$process = [System.Diagnostics.Process]::Start($info)
$connections += $process
}
# Keep every connection active for approximately 12 minutes.
1..12 | ForEach-Object {
$minute = $_
foreach ($process in $connections) {
if ($process.HasExited) {
throw "SFTP process $($process.Id) exited unexpectedly."
}
$process.StandardInput.WriteLine("ls .")
$process.StandardInput.Flush()
}
Write-Host "Minute ${minute}: sent requests to all 10 sessions."
Start-Sleep -Seconds 60
}
}
finally {
# Close only the processes created by this test.
foreach ($process in $connections) {
if (-not $process.HasExited) {
$process.StandardInput.Close()
if (-not $process.WaitForExit(3000)) {
$process.Kill()
}
}
$process.Dispose()
}
Write-Host "Test connections closed."
}
I will execute the following in another PowerShell window to check on concurrency -
$port = [int](Read-Host "Enter your OIC File Server port")
$connections = @(
Get-NetTCPConnection -State Established |
Where-Object { $_.RemotePort -eq $port }
)
$connections |
Format-Table LocalPort, RemoteAddress, RemotePort, OwningProcess
"Established connections to port ${port}: $($connections.Count)"
I begin by outputting current datetime in both windows -
Now set the metric filter to 5 minutes / sum
Here's a 6 hour view of the metrics -
Note, I ran a similar test, a couple of hours before. Also note how we do not see a line down to 0, after the 2nd test ended. Again, be aware the stats are emitted every 5 minutes, giving us a view of connection concurrency at that particular point in time.
Let's try the following - I will have the same 10 connections test running for 12 minutes in one window. In other I'll have a shorter test for 20 connections for 3 minutes.
Here we see a peak at 14, before falling back to 10. Ergo, the peak of 30 concurrent connections is not highlighted.
Summa Summarum
The metric in its current iteration is useful for highlighting trends, however, due to the 5 minute sampling, it is not able to provide an exact view of concurrent connections. Remember to switch the time window to 5 minutes, and you're good to go!






















































