Giter Site home page Giter Site logo

Comments (8)

simonw avatar simonw commented on May 24, 2024

It looks like you do this using the flyctl scale vm command - but the docs at https://fly.io/docs/flyctl/scale-vm/ are missing some details.

Filed a documentation bug with Fly about that here: superfly/flyctl#83

from datasette-publish-fly.

simonw avatar simonw commented on May 24, 2024

I can get the list of available sizes like so:

~ $ flyctl platform vm-sizes
  NAME       CPU CORES   MEMORY   PRICE (SECOND)   PRICE (MONTH)  
  micro-1x   0.12        128 MB   $0.000001        $2.670000      
  micro-2x   0.25        512 MB   $0.000003        $8.000000      
  cpu1mem1   1           1 GB     $0.000013        $35.000000     
  cpu2mem2   2           2 GB     $0.000027        $70.000000     
  cpu4mem4   4           4 GB     $0.000053        $140.000000    
  cpu8mem8   8           8 GB     $0.000107        $280.000000    

Displaying the price to users feels useful here.

from datasette-publish-fly.

simonw avatar simonw commented on May 24, 2024

flyctl platform vm-sizes --json

[
    {
        "Name": "micro-1x",
        "CPUCores": 0.125,
        "MemoryGB": 0.125,
        "MemoryMB": 128,
        "PriceMonth": 2.67,
        "PriceSecond": 0.000001015
    },
    {
        "Name": "micro-2x",
        "CPUCores": 0.25,
        "MemoryGB": 0.5,
        "MemoryMB": 512,
        "PriceMonth": 8,
        "PriceSecond": 0.000003044
    },
    {
        "Name": "cpu1mem1",
        "CPUCores": 1,
        "MemoryGB": 1,
        "MemoryMB": 1024,
        "PriceMonth": 35,
        "PriceSecond": 0.000013318
    },
    {
        "Name": "cpu2mem2",
        "CPUCores": 2,
        "MemoryGB": 2,
        "MemoryMB": 2048,
        "PriceMonth": 70,
        "PriceSecond": 0.000026636
    },
    {
        "Name": "cpu4mem4",
        "CPUCores": 4,
        "MemoryGB": 4,
        "MemoryMB": 4096,
        "PriceMonth": 140,
        "PriceSecond": 0.000053272
    },
    {
        "Name": "cpu8mem8",
        "CPUCores": 8,
        "MemoryGB": 8,
        "MemoryMB": 8192,
        "PriceMonth": 280,
        "PriceSecond": 0.000106544
    }
]

from datasette-publish-fly.

simonw avatar simonw commented on May 24, 2024

That's disappointing: I tried this command again today and it doesn't return accurate pricing information any more:

~ % flyctl platform vm-sizes --json
[
    {
        "Name": "shared-cpu-1x",
        "CPUCores": 1,
        "MemoryGB": 0,
        "MemoryMB": 256,
        "PriceMonth": 0,
        "PriceSecond": 0
    },
    {
        "Name": "dedicated-cpu-1x",
        "CPUCores": 1,
        "MemoryGB": 0,
        "MemoryMB": 2048,
        "PriceMonth": 0,
        "PriceSecond": 0
    },
...

from datasette-publish-fly.

simonw avatar simonw commented on May 24, 2024

Filed that as a bug: superfly/flyctl#339

from datasette-publish-fly.

simonw avatar simonw commented on May 24, 2024

Today the command returns this:

[
    {
        "Name": "shared-cpu-1x",
        "CPUCores": 1,
        "MemoryGB": 0.25,
        "MemoryMB": 256,
        "PriceMonth": 1.94,
        "PriceSecond": 7.5e-7,
        "MemoryIncrementsMB": [
            256,
            1024,
            2048
        ]
    },
    {
        "Name": "dedicated-cpu-1x",
        "CPUCores": 1,
        "MemoryGB": 2,
        "MemoryMB": 2048,
        "PriceMonth": 31,
        "PriceSecond": 0.00001196,
        "MemoryIncrementsMB": [
            2048,
            4096,
            8192
        ]
    },
    {
        "Name": "dedicated-cpu-2x",
        "CPUCores": 2,
        "MemoryGB": 4,
        "MemoryMB": 4096,
        "PriceMonth": 62,
        "PriceSecond": 0.00002392,
        "MemoryIncrementsMB": [
            4096,
            8192,
            16384
        ]
    },
    {
        "Name": "dedicated-cpu-4x",
        "CPUCores": 4,
        "MemoryGB": 8,
        "MemoryMB": 8192,
        "PriceMonth": 124,
        "PriceSecond": 0.00004784,
        "MemoryIncrementsMB": [
            8192,
            16384,
            32768
        ]
    },
    {
        "Name": "dedicated-cpu-8x",
        "CPUCores": 8,
        "MemoryGB": 16,
        "MemoryMB": 16384,
        "PriceMonth": 248,
        "PriceSecond": 0.00009568,
        "MemoryIncrementsMB": [
            16384,
            32768,
            65536
        ]
    }
]

from datasette-publish-fly.

simonw avatar simonw commented on May 24, 2024

The command for this is:

flyctl scale vm dedicated-cpu-1x

You can pass an optional --memory option:

flyctl scale vm dedicated-cpu-1x --memory=2048

The docs are at https://fly.io/docs/flyctl/scale-vm/

Valid memory values aren't completely clear. Documentation says:

For dedicated vms, this should be a multiple of 1024MB.

For shared vms, this can be 256MB or a a multiple of 1024MB.

But... the output of flyctl platform vm-sizes --json includes a MemoryIncrementsMB key which looks like this for the largest instance:

{
    "Name": "dedicated-cpu-8x",
    "CPUCores": 8,
    "MemoryGB": 16,
    "MemoryMB": 16384,
    "PriceMonth": 248,
    "PriceSecond": 0.00009568,
    "MemoryIncrementsMB": [
        16384,
        32768,
        65536
    ]
}

Are those three values the only valid options for --memory?

from datasette-publish-fly.

simonw avatar simonw commented on May 24, 2024

Posted a question about this here: superfly/flyctl#478

from datasette-publish-fly.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.