1

In the configuration for my Pyhon 3.6 AWS Lambda function I set the environment variable "PYTHONVERBOSE" with a setting of 1

Then in the Cloudwatch logs for my function it shows lots of messages similar to:

could not create '/var/task/pycache/auth.cpython-36.pyc': OSError(30, 'Read-only file system')

Is this important? Do I need to fix it?

Duke Dougal
  • 24,359
  • 31
  • 91
  • 123
  • Are you experiencing any problems with your Lambda function? – John Rotenstein Jul 23 '17 at 22:33
  • @johnrotenstien Not that I know of, but I do wonder if all those attempts to write to a read only file system are slowing it down, plus I wonder if some performance gain from successful pyc writes is forgone. – Duke Dougal Jul 23 '17 at 23:18
  • Not an answer to your question but I am seeing huge performance difference when not providing pyc files with my Python package to Lambda. Some 3rd party libraries I'm trying to import load 10x times slower without my local pyc files. When I do include pyc files, only the first invocation is slower. I was puzzled by this behavior, but when I found this question it made me suspect that Lambda is trying to create pyc files but fails due to read only file system? Can't find any information about this anywhere. – danielv Aug 13 '17 at 19:12

1 Answers1

1

I don't think you can write in the /var/task/ folder. If you want to write something to disk inside of the lambda runtime try the /tmp folder.

Dan Borza
  • 3,419
  • 3
  • 22
  • 16