Hi Team, We have 10 pods for rudder backend servic...
# support
w
Hi Team, We have 10 pods for rudder backend service associated to 10 postgres pods. Out of which 2 pods (i.e backend service & postgres) were using more than 100% memory & CPU utilization respectively. ◦ All backend service pods were restarted/reassigned to different node ◦ Rudder service was down for 10 mins which caused data loss ◦ Only 2 PODS were receiving maximum requests and other 8 were idle Below are errors on ALL postgres PODS:
Copy code
FATAL: terminating connection because protocol synchronization was lost
Copy code
{kubernetes:{namespace_name:prod-dataplatformpod_name:rudderstack-service-rudderstack-postgresql-v5-0host:ip-10-1-94-191.ap-south-1.compute.internal}log:2022-11-30 11:35:06.153 UTC [2973] FATAL: terminating connection due to administrator command
Copy code
{kubernetes:{namespace_name:prod-dataplatformpod_name:rudderstack-service-rudderstack-postgresql-v5-0host:ip-10-1-94-191.ap-south-1.compute.internal}log:2022-11-30 11:41:18.459 UTC [4514] FATAL: connection to client lost
Copy code
{kubernetes:{namespace_name:prod-dataplatformpod_name:rudderstack-service-rudderstack-postgresql-v5-0host:ip-10-1-94-191.ap-south-1.compute.internal}log:2022-11-30 11:38:38.899 UTC [3955] FATAL: terminating connection because protocol synchronization was lost
Here is our config:
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: 2
  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: 7000
  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: false
  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
Can someone please take a look at it.
b
Hi @worried-lighter-96658, thanks for reaching out, our team will get back with you shortly. Looping in @shy-kite-21035 here for further assistance
👍 1
w
Image used: rudderlabs/rudder-server:1.0.2
g
@worried-lighter-96658 This is a k8s abstraction and you would probably want to check why k8s service is sending all requests to same pods. We found a similar discussion on StackOverflow which suggests a solution - https://stackoverflow.com/questions/68956982/kubernetes-service-not-distributing-the-traffic-evenly-among-pods
👍 1
w
@gentle-petabyte-80785 Can you also get some help on point 1 i.e
All backend service pods were restarted/reassigned to different node
Why all rudder backend pods were restarted/reassigned once few postgres pods gets 100% cpu and memory usage ?
g
Isn't that also related to k8s service?
w
only for 2 pods got crashed but rest 8 pods also got restarted although mem and cpu was < 30%
g
This might be the k8s config that is forcing to restart all pods on failure. Maybe check for rollout/restart commands in your k8s service.
w
sure, will check that. Thank you Pradeep
Restarting the entire service including backend server and database has solve the issue