Skip to content

How to config to serve large scale request #5

Open
@kingstonduy

Description

@kingstonduy

Hi @tsurdilo,

I find your repository very useful. However when i use docker to run the your set up temporal server

docker network create temporal-network
docker compose -f compose-postgres.yml -f compose-services.yml up --detach

When i start 1000 workflows, each workflow has 8 activites. the average time for each request is 8 seconds (is it normal? To me it is insanely slow).
This is the code i set up the worker in go:

	workers := 100
	var forever chan int
	for i := 0; i < workers; i++ {
		go func() {
			// This worker hosts both Workflow and Activity functions
			w := worker.New(*bootstrap.GetTemporalClient(mw.cfg), mw.cfg.Temporal.TaskQueue, worker.Options{
				MaxConcurrentActivityTaskPollers: 10,
				MaxConcurrentWorkflowTaskPollers: 10,
				Identity:                         uuid.New(),
			})

			w.RegisterWorkflowWithOptions(usecase.MoneyTransferWorkflow, workflow.RegisterOptions{
				Name: "MoneyTransferService",
			})

			w.RegisterActivity(activity1)
			w.RegisterActivity(activity2)
                        w.RegisterActivity(activity3)
                        w.RegisterActivity(activity4)
                        ...
                        w.RegisterActivity(activity7)
                        w.RegisterActivity(activity8)
			// Start listening to the Task Queue
			err := w.Start()
			if err != nil {
				log.Fatalln("unable to start Worker", err)
			}
		}()
	}
	<-forever
}

So my question is: Did i config the worker in a wrong way or i just need to scale the temporal if it is can you specify how to scale it properly.

Thank you for reading.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions