Hey folks, I see rudderstack generating very small...
# support
d
Hey folks, I see rudderstack generating very small files when ingesting the data into our S3 data lake. I took a look at this config parameters page, but no clue on how to improve this. Any hint? Thank you in advance!
m
Hey There! 👋 Your message has been received by the RudderStack team. We will forward this request to your Technical Account Manager, and they will get back to you shortly. Please use the thread for any additional comments.
Hi Jaoa, I did not understand what you mean by very small files. Is all the data not present in the s3 datalake?
d
Hi Ranganath, If I send 3 events, instead of creating a single file, it creates one file
json.gz
for every event in s3
m
Hi, Joao are there multiple sources you are sending data from? Can you share your workspace Id and Destination Id?
d
No, these events come from the same source. I'm using the open source version running in a k8s cluster
m
Can you share what events you are sending. Rudderstack creates tracks tables for each type of track event. Also for s3 data lake events are stored datewise. So if you have the following events, they will be stored in the pattern shown below. Read below as event_name and date 1. 'Product Added' - 31/07/2023 2. 'Product Viewed' - 31/07/2023 3. 'Product Added' - 01/08/2023 The above events will create the following partitions 1. Tracks - 31/07/2023 2. Tracks - 01/08/2023 3. Product Added - 31/07/2023 4. Product Viewed - 31/07/2023 5. Product Added - 01/08/2023
d
I'm using this same event for tests:
Copy code
{
  "userId": "user123",
  "event": "Product Purchased",
  "properties": {
    "name": "Rubik's Cube",
    "revenue": 4.99
  },
  "context": {
    "ip": "14.5.67.21"
  },
  "timestamp": "2023-08-01T00:23:09.544Z"
}
You can notice that almost every event became a different file
m
Oh ok let me check on this and get back to you
Hi Joao, so what is the path you are looking at. I am seeing *parquet*⁣ files created in this path Amazon s3 > Buckets > My-Bucket > Destination Name > Source Name > Event Type > Year(2023) > Month > Date > Hour
d
image.png
version of the backend:
Copy code
backend:
      image:
        repository: rudderlabs/rudder-server
        version: 1-alpine
        pullPolicy: Always
Config is mostly using the default values:
Copy code
maxProcess: 12
    gwDBRetention: 0h
    routerDBRetention: 0h
    enableProcessor: true
    enableRouter: true
    enableStats: true
    statsTagsFormat: influxdb
    Http:
      ReadTimeout: 0s
      ReadHeaderTimeout: 0s
      WriteTimeout: 10s
      IdleTimeout: 720s
      MaxHeaderBytes: 524288
    RateLimit:
      eventLimit: 1000
      rateLimitWindow: 60m
      noOfBucketsInWindow: 12
    Gateway:
      webPort: 8080
      maxUserWebRequestWorkerProcess: 64
      maxDBWriterProcess: 256
      CustomVal: GW
      maxUserRequestBatchSize: 128
      maxDBBatchSize: 128
      userWebRequestBatchTimeout: 15ms
      dbBatchWriteTimeout: 5ms
      maxReqSizeInKB: 4000
      enableRateLimit: false
      enableSuppressUserFeature: true
      allowPartialWriteWithErrors: true
      allowReqsWithoutUserIDAndAnonymousID: false
      webhook:
        batchTimeout: 20ms
        maxBatchSize: 32
        maxTransformerProcess: 64
        maxRetry: 5
        maxRetryTime: 10s
        sourceListForParsingParams:
          - shopify
    EventSchemas:
      enableEventSchemasFeature: false
      syncInterval: 240s
      noOfWorkers: 128
    Debugger:
      maxBatchSize: 32
      maxESQueueSize: 1024
      maxRetry: 3
      batchTimeout: 2s
      retrySleep: 100ms
    SourceDebugger:
      disableEventUploads: false
    DestinationDebugger:
      disableEventDeliveryStatusUploads: false
    TransformationDebugger:
      disableTransformationStatusUploads: false
    Archiver:
      backupRowsBatchSize: 100
    JobsDB:
      jobDoneMigrateThres: 0.8
      jobStatusMigrateThres: 5
      maxDSSize: 100000
      maxMigrateOnce: 10
      maxMigrateDSProbe: 10
      maxTableSizeInMB: 300
      migrateDSLoopSleepDuration: 30s
      addNewDSLoopSleepDuration: 5s
      refreshDSListLoopSleepDuration: 5s
      backupCheckSleepDuration: 5s
      backupRowsBatchSize: 1000
      archivalTimeInDays: 10
      archiverTickerTime: 1440m
      backup:
        enabled: true
        gw:
          enabled: true
          pathPrefix: ""
        rt:
          enabled: true
          failedOnly: true
        batch_rt:
          enabled: false
          failedOnly: false
    Router:
      jobQueryBatchSize: 10000
      updateStatusBatchSize: 1000
      readSleep: 1000ms
      fixedLoopSleep: 0ms
      noOfJobsPerChannel: 1000
      noOfJobsToBatchInAWorker: 20
      jobsBatchTimeout: 5s
      maxSleep: 60s
      minSleep: 0s
      maxStatusUpdateWait: 5s
      useTestSink: false
      guaranteeUserEventOrder: true
      kafkaWriteTimeout: 2s
      kafkaDialTimeout: 10s
      minRetryBackoff: 10s
      maxRetryBackoff: 300s
      noOfWorkers: 64
      allowAbortedUserJobsCountForProcessing: 1
      maxFailedCountForJob: 3
      retryTimeWindow: 180m
      failedKeysEnabled: false
      saveDestinationResponseOverride: false
      responseTransform: false
      MARKETO:
        noOfWorkers: 4
      throttler:
        MARKETO:
          limit: 45
          timeWindow: 20s
      BRAZE:
        forceHTTP1: true
        httpTimeout: 120s
        httpMaxIdleConnsPerHost: 32
    BatchRouter:
      mainLoopSleep: 2s
      jobQueryBatchSize: 100000
      uploadFreq: 30s
      warehouseServiceMaxRetryTime: 3h
      noOfWorkers: 8
      maxFailedCountForJob: 128
      retryTimeWindow: 180m
    Warehouse:
      mode: embedded
      webPort: 8082
      uploadFreq: 1800s
      noOfWorkers: 8
      noOfSlaveWorkerRoutines: 4
      mainLoopSleep: 5s
      minRetryAttempts: 3
      retryTimeWindow: 180m
      minUploadBackoff: 60s
      maxUploadBackoff: 1800s
      warehouseSyncPreFetchCount: 10
      warehouseSyncFreqIgnore: false
      stagingFilesBatchSize: 960
      enableIDResolution: false
      populateHistoricIdentities: false
      redshift:
        maxParallelLoads: 3
        setVarCharMax: false
      snowflake:
        maxParallelLoads: 3
      bigquery:
        maxParallelLoads: 20
      postgres:
        maxParallelLoads: 3
      mssql:
        maxParallelLoads: 3
      azure_synapse:
        maxParallelLoads: 3
      clickhouse:
        maxParallelLoads: 3
        queryDebugLogs: false
        blockSize: 1000
        poolSize: 10
        disableNullable: false
        enableArraySupport: false
    Processor:
      webPort: 8086
      loopSleep: 10ms
      maxLoopSleep: 5000ms
      fixedLoopSleep: 0ms
      maxLoopProcessEvents: 10000
      transformBatchSize: 100
      userTransformBatchSize: 200
      maxConcurrency: 200
      maxHTTPConnections: 100
      maxHTTPIdleConnections: 50
      maxRetry: 30
      retrySleep: 100ms
      timeoutDuration: 30s
      errReadLoopSleep: 30s
      errDBReadBatchSize: 1000
      noOfErrStashWorkers: 2
      maxFailedCountForErrJob: 3
      Stats:
        captureEventName: false
    Dedup:
      enableDedup: false
      dedupWindow: 3600s
    BackendConfig:
      configFromFile: true
      configJSONPath: /etc/rudderstack/workspaceConfig.json
      pollInterval: 5s
      regulationsPollInterval: 300s
      maxRegulationsPerRequest: 1000
    recovery:
      enabled: true
      errorStorePath: /tmp/error_store.json
      storagePath: /tmp/recovery_data.json
      normal:
        crashThreshold: 5
        duration: 300s
    Logger:
      enableConsole: true
      enableFile: false
      consoleJsonFormat: false
      fileJsonFormat: false
      logFileLocation: /tmp/rudder_log.log
      logFileSize: 100
      enableTimestamp: true
      enableFileNameInLog: true
      enableStackTrace: false
    Diagnostics:
      enableDiagnostics: true
      gatewayTimePeriod: 60s
      routerTimePeriod: 60s
      batchRouterTimePeriod: 6l
      enableServerStartMetric: true
      enableConfigIdentifyMetric: true
      enableServerStartedMetric: true
      enableConfigProcessedMetric: true
      enableGatewayMetric: true
      enableRouterMetric: true
      enableBatchRouterMetric: true
      enableDestinationFailuresMetric: true
    RuntimeStats:
      enabled: true
      statsCollectionInterval: 10
      enableCPUStats: true
      enableMemStats: true
      enableGCStats: true
    PgNotifier:
      retriggerInterval: 2s
      retriggerCount: 500
      trackBatchInterval: 2s
      maxAttempt: 3
m
The server seems to be a relatively new version. Can you mention the transformer version as well?
You are looking at the staging files. Can you please correct the path.
d
transformer:
Copy code
image:
        repository: rudderlabs/rudder-transformer
        version: latest
        pullPolicy: Always
You are looking at the staging files. Can you please correct the path.
I'm not sure if I got it, but I don't think so. Below is the destination config:
Copy code
"destinations": [
    {
        "config": {
            "bucketName": "...",
            "prefix": "",
            "accessKeyID": "...",
            "accessKey": "...",
            "enableSSE": false
        },
        "liveEventsConfig": {},
        "secretConfig": {},
        "id": "...",
        "name": "Datalake",
        "enabled": true,
        "workspaceId": "...",
        "deleted": false,
        "createdAt": "2022-03-28T09:17:08.632Z",
        "updatedAt": "2022-08-30T14:03:53.055Z",
        "revisionId": "...",
        "secretVersion": 1,
        "transformations": [],
        "destinationDefinition": {
            "config": {
                "destConfig": {
                    "defaultConfig": [
                        "bucketName",
                        "prefix",
                        "accessKeyID",
                        "accessKey",
                        "enableSSE"
                    ]
                },
                "secretKeys": [
                    "accessKeyID",
                    "accessKey"
                ],
                "excludeKeys": [],
                "includeKeys": [],
                "transformAt": "none",
                "transformAtV1": "none",
                "supportedSourceTypes": [
                    "android",
                    "ios",
                    "web",
                    "unity",
                    "amp",
                    "cloud",
                    "warehouse",
                    "reactnative",
                    "cloudSource",
                    "flutter",
                    "cordova"
                ],
                "saveDestinationResponse": true
            },
            "configSchema": null,
            "responseRules": null,
            "options": null,
            "uiConfig": null,
            "id": "...",
            "name": "S3",
            "displayName": "Amazon S3",
            "category": null,
            "createdAt": "2019-09-24T06:48:38.334Z",
            "updatedAt": "2022-01-20T11:42:06.191Z"
        },
        "isConnectionEnabled": true,
        "isProcessorEnabled": true
    }
]
By filling the bucket, it generates the
rudder-logs
folder. Then, the next folder level refers to the source's name
m
Are there any other folders in the bucket apart from the rudder-logs. Also can you confirm that you created the Amazon s3 data-lake destination and not the Amazon s3 destination. RudderStack supports warehouse destinations such as s3, s3 Datalake, Postgres, Redshift, Snowflake etc. However, when we send data to a warehouse, we keep a backup in an S3 warehouse (it is always s3). As you are self-hosted you would have to setup such a backup warehouse. Could it be possible that you are mixing up these 2?
d
You're right, I'm using the Amazon s3 destination. For us, I don't see advantages using the S3 Datalake, as we don't intend to use Glue, for instance. Also, I'm afraid of syncing the data only within a big time interval, like 30 minutes at minimum. I think the current setup is good for us, but I'd like to improve a little the size or frequency of these generated files
I might be missing different features between these two destinations, btw
m
Yes the Data-lake is more used by analytics teams while s3 is used more for storage.
d
isn't there a config to update this behavior using the s3 destination?
m
Don't think we have such a feature.
d
Got it. Thank you for the help, Ranganath