Hey <@U01N7EB26MR>, trying to dig into this a bit ...
# sst
f
Hey @gio, trying to dig into this a bit
SST needs some speed up
By slow, do you mean the handler function is taking long to run locally in
sst start
?
RAM reach 4gb
Can you see which process is this? Is it
esbuild
?
g
hello @Frank, as I said SST is running through Webstorm, it needs much time to show “Listening Request”. I can’t see “esbuild” process in my process list (I run ps aux) but the process which consume much resources is “webstorm” process. I think there is some optimization to make to work properly with webstorm because the “indexing processing” is invoked several times (and until finished it is impossible to make any action on code)
@Ross Coundon do you know if your colleague had the same “indexing” issue?
r
I'm not sure of the specifics, but I'll ask
f
it needs much time to show “Listening Request”
Is it also slow if you stop the
sst start
debug process and restart it?
That should start up in a few seconds.
g
yes it will be started fast, the only problem is during the execution (for indexing problem) and sometimes after a deploy (but it’s not a problem)
f
By “during the execution”, do you mean the indexing problems happens when executing the Lambda locally when a request comes in?
g
yes
and If I’m not wrong also if It doesn’t receive request
let me check
yes indexing process is run also when I don’t get request, but I think indexing couldn’t be a problem. If I don’t do anything Webstorm consume 3gb and more on my RAM, and whatever thing I do is slow, probably this indexing process is showed only because everything is stuck
How much ram should consume SST on start?
f
hmm.. It consumes ~70MB for me
@gio Is ur SST app sitting at the repo root or is it in a sub directory?
g
It sit at root
f
I see.. and are you setting
srcPath
for your functions?
g
Copy code
export class VehiclesApi extends sst.Api {
    constructor (stack: sst.Stack, app: <http://sst.App|sst.App>, id: string) {
        const definition: ApiProps = {
            accessLog:
                '$context.identity.sourceIp,$context.requestTime,$context.httpMethod,$context.routeKey,$context.protocol,$context.status,$context.responseLength,$context.requestId',
            customDomain: {
                domainName: apigatewayv2.DomainName.fromDomainNameAttributes(
                    stack,
                    'vehicles-api-domain',
                    {
                        name: '<http://api.dev.irent-autonoleggio.com|api.dev.irent-autonoleggio.com>',
                        regionalDomainName: '<http://app.dev.irent-autonoleggio.com|app.dev.irent-autonoleggio.com>',
                        regionalHostedZoneId: '<http://dev.irent-autonoleggio.com|dev.irent-autonoleggio.com>',
                    }
                ),
                path: 'vehicles'
            },
            defaultAuthorizationType: ApiAuthorizationType.AWS_IAM,
            defaultFunctionProps: {
                timeout: 300,
                environment: {
                    STAGE: app.stage
                }
            },
            routes: {
                'POST   /'                          : 'src/vehicles-api/vehicles-api.createVehicle',
                'GET    /{uri}'                     : 'src/vehicles-api/vehicles-api.readVehicle',
                'PUT    /{uri}'                     : 'src/vehicles-api/vehicles-api.updateVehicle',
                'DELETE /{uri}'                     : 'src/vehicles-api/vehicles-api.deleteVehicle',
                'GET    /'                          : {
                    authorizationType: ApiAuthorizationType.NONE,
                    function: 'src/vehicles-api/vehicles-api.findVehicle',
                },
                'GET    /{start_date}/{end_date}'   : {
                    authorizationType: ApiAuthorizationType.NONE,
                    function: 'src/vehicles-api/vehicles-api.listAvailableVehicles',
                },
            }
        };
        super (stack, id, definition);
        this.attachPermissions(['dynamodb']);
    }
}
This is my API definition
I never declare srcPath attribute, also in a Cron task I declared
d
Here’s my esbuild process in activity monitor
f
Hey @David Martin what’s ur SST version? We rolled out a fix addressing the esbuild memory usage recently.
d
0.35.1
oh it’s old
upgrading…
f
Yup
d
beautiful
@Frank, i know i owe you a response on the graphql parsing issue. i hope to get to it today.
f
lol all good 👍
Hey @gio, your app looks pretty standard. I’m not too familiar with what the indexing process do in Webstorm. I will take a look at it next week as i’m thinking to create an example on how to use SST with Webstorm.
g
thanks Frank 🙌